From 9a39af7303a1ec52e1d23df46a3cd42a691141eb Mon Sep 17 00:00:00 2001 From: "wtchang%redhat.com" Date: Tue, 25 Jan 2005 22:24:12 +0000 Subject: [PATCH] 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 . r=wtc. --- nsprpub/pr/src/md/os2/os2inrval.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nsprpub/pr/src/md/os2/os2inrval.c b/nsprpub/pr/src/md/os2/os2inrval.c index aa928ed369d7..4006f5f2b0aa 100644 --- a/nsprpub/pr/src/md/os2/os2inrval.c +++ b/nsprpub/pr/src/md/os2/os2inrval.c @@ -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);