diff options
author | sdagley%netscape.com <devnull@localhost> | 1999-07-22 21:28:34 +0000 |
---|---|---|
committer | sdagley%netscape.com <devnull@localhost> | 1999-07-22 21:28:34 +0000 |
commit | c402ea8b9f4d129494fd30bf9dc1f4c5ccacf36f (patch) | |
tree | 8a4f48e641941a66936bdf8b3d5ce52c49513c6e | |
parent | 4585aa328c1eaea0a3a1f6f504e5585446d57b36 (diff) | |
download | nspr-hg-c402ea8b9f4d129494fd30bf9dc1f4c5ccacf36f.tar.gz |
Fix bug #3537. Replaced call of Delay() with WaitNextEvent() so that we'll yield to other processes if we're in some long wait for i/o.
-rw-r--r-- | pr/src/md/mac/macthr.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pr/src/md/mac/macthr.c b/pr/src/md/mac/macthr.c index b760bfb3..501cf629 100644 --- a/pr/src/md/mac/macthr.c +++ b/pr/src/md/mac/macthr.c @@ -196,10 +196,21 @@ void _MD_PauseCPU(PRIntervalTime timeout) { #pragma unused (timeout) - unsigned long finalTicks; + /* unsigned long finalTicks; */ + EventRecord theEvent; if (timeout != PR_INTERVAL_NO_WAIT) { - Delay(1,&finalTicks); + /* Delay(1,&finalTicks); */ + + /* + ** Rather than calling Delay() which basically just wedges the processor + ** we'll instead call WaitNextEvent() with a mask that ignores all events + ** which gives other apps a chance to get time rather than just locking up + ** the machine when we're waiting for a long time (or in an infinite loop, + ** whichever comes first) + */ + (void)WaitNextEvent(nullEvent, &theEvent, 1, NULL); + (void) _MD_IOInterrupt(); } } |