diff options
author | sfraser%netscape.com <devnull@localhost> | 2002-01-31 06:20:15 +0000 |
---|---|---|
committer | sfraser%netscape.com <devnull@localhost> | 2002-01-31 06:20:15 +0000 |
commit | 92b789bfe4099365da85b735fd46f3e9d90be98f (patch) | |
tree | a4f3290506acaa7d93abf7270e58a96a1dd966bf | |
parent | 6b1e08bd891996e60ed63b3b35f4be9a0b643ab1 (diff) | |
download | nspr-hg-MOZILLA_0_9_8_BRANCH.tar.gz |
Workaround for deadlock condition seen on dual CPU machines running Mac OS X; cap the MD_PauseCPU timeout to 500ms so that we don't stall for longer than that on startup. This does not affect Mac OS 9 builds (which ignore the time parameter). Bug 99561. r=dagley, wtc. a=asaMOZILLA_0_9_8_RELEASEMOZILLA_0_9_8_BRANCH
-rw-r--r-- | pr/src/md/mac/macthr.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pr/src/md/mac/macthr.c b/pr/src/md/mac/macthr.c index 8838ef15..e84e38a2 100644 --- a/pr/src/md/mac/macthr.c +++ b/pr/src/md/mac/macthr.c @@ -222,10 +222,21 @@ void _MD_StopInterrupts(void) } } + +#define MAX_PAUSE_TIMEOUT_MS 500 + void _MD_PauseCPU(PRIntervalTime timeout) { if (timeout != PR_INTERVAL_NO_WAIT) { + // There is a race condition entering the critical section + // in AsyncIOCompletion (and probably elsewhere) that can + // causes deadlock for the duration of this timeout. To + // work around this, use a max 500ms timeout for now. + // See bug 99561 for details. + if (PR_IntervalToMilliseconds(timeout) > MAX_PAUSE_TIMEOUT_MS) + timeout = PR_MillisecondsToInterval(MAX_PAUSE_TIMEOUT_MS); + WaitOnIdleSemaphore(timeout); (void) _MD_IOInterrupt(); } |