Merged with HEAD from 8/18 or so. unlabeled-3.5.14
authorcls%seawood.org
Fri, 20 Aug 1999 16:21:39 +0000
branchunlabeled-3.5.14
changeset 773 cdbec9fd48c3
parent 603 203bccfde414
push idunknown
push userunknown
push dateunknown
Merged with HEAD from 8/18 or so.
pr/src/md/mac/macthr.c
--- a/pr/src/md/mac/macthr.c
+++ b/pr/src/md/mac/macthr.c
@@ -191,20 +191,31 @@ void _MD_StopInterrupts(void)
 		gTimeManagerTaskElem.tmAddr = NULL;
 	}
 }
 
 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();
 	}
 }
 
 
 //##############################################################################
 //##############################################################################
 #pragma mark -