Bugzilla Bug 277514: added an environment variable NSPR_OS2_NO_HIRES_TIMER

that a user can set to disable the use of high-resolution timer
DosTmrQueryTime().  The patch is contributed by Michael Kaply
<mkaply@us.ibm.com>. r=wtc.
This commit is contained in:
wtchang%redhat.com 2005-01-25 22:24:12 +00:00
Родитель 26d59e8fa8
Коммит 9a39af7303
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -50,8 +50,17 @@ PRInt32 _os2_highMask = 0;
void
_PR_MD_INTERVAL_INIT()
{
ULONG timerFreq = 0; /* OS/2 high-resolution timer frequency in Hz */
APIRET rc = DosTmrQueryFreq(&timerFreq);
char *envp;
ULONG timerFreq;
APIRET rc;
if ((envp = getenv("NSPR_OS2_NO_HIRES_TIMER")) != NULL) {
if (atoi(envp) == 1)
return;
}
timerFreq = 0; /* OS/2 high-resolution timer frequency in Hz */
rc = DosTmrQueryFreq(&timerFreq);
if (NO_ERROR == rc) {
useHighResTimer = PR_TRUE;
PR_ASSERT(timerFreq != 0);