diff options
author | sfraser%netscape.com <devnull@localhost> | 2002-03-05 00:51:52 +0000 |
---|---|---|
committer | sfraser%netscape.com <devnull@localhost> | 2002-03-05 00:51:52 +0000 |
commit | 26d27f7bbefbcf4e9fe5a8dbfd10b44ae184e127 (patch) | |
tree | 0f360addfff8477fcbbe28b3d2bd1db8b39e6477 | |
parent | 97946a14f74b6ed9d38b77e17db2b34b99841f6c (diff) | |
download | nspr-hg-26d27f7bbefbcf4e9fe5a8dbfd10b44ae184e127.tar.gz |
Workaround fix for a stall on launch on dual CPU OS X machines, that is caused by a race condition entering the critical section. Bug 99561. r=wtc, a=dbaronSYD_TEST_03052002_BASE
-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(); } |