changeset 39105:c56375806351

2001-09-04 Andrew Choi <akochoi@cse.cuhk.edu.hk> * src/mac.c (sleep) [__MRC__]: Place loop around WaitNextEvent to check time elapsed instead of use WaitNextEvent call as a delay.
author Andrew Choi <akochoi@shaw.ca>
date Tue, 04 Sep 2001 06:12:57 +0000
parents 6addcec799eb
children dc9d8a2e8650
files mac/ChangeLog mac/src/mac.c
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mac/ChangeLog	Tue Sep 04 05:45:39 2001 +0000
+++ b/mac/ChangeLog	Tue Sep 04 06:12:57 2001 +0000
@@ -9,7 +9,9 @@
 	* src/mac.c (stat): Don't fail for aliases.
 	(sys_open) [__MRC__]: Set file creator and type for newly-created
 	files.
-
+	(sleep) [__MRC__]: Place loop around WaitNextEvent to check time
+	elapsed instead of use WaitNextEvent call as a delay.
+	
 2001-08-24  Andrew Choi  <akochoi@cse.cuhk.edu.hk>
 
 	* src/macterm.c (init_font_name_table): Add an additional entry to
--- a/mac/src/mac.c	Tue Sep 04 05:45:39 2001 +0000
+++ b/mac/src/mac.c	Tue Sep 04 06:12:57 2001 +0000
@@ -969,9 +969,15 @@
 unsigned int
 sleep (unsigned int seconds)
 {
+  unsigned long time_up;
   EventRecord e;
 
-  WaitNextEvent (0, &e, seconds * 60UL, NULL);	/* Accept no event; just wait. by T.I.*/
+  time_up = TickCount () + seconds * 60;
+  while (TickCount () < time_up)
+    {
+      /* Accept no event; just wait. by T.I.  */
+      WaitNextEvent (0, &e, 30, NULL);
+    }
 
   return (0);
 }