changeset 11480:1d5205bab61a

Sleep(0) != usleep(0), bugreport by Paul-Kenji Cahier
author faust3
date Sun, 16 Nov 2003 15:11:52 +0000
parents 5d76d070b44b
children 64298443e494
files osdep/timer-win2.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/osdep/timer-win2.c	Sun Nov 16 14:37:42 2003 +0000
+++ b/osdep/timer-win2.c	Sun Nov 16 15:11:52 2003 +0000
@@ -15,6 +15,10 @@
 }
 
 int usec_sleep(int usec_delay){
+  // Sleep(0) won't sleep for one clocktick as the unix usleep 
+  // instead it will only make the thread ready
+  // it may take some time until it actually starts to run again
+  if(usec_delay<1000)usec_delay=1000;  
   Sleep( usec_delay/1000);
   return 0;
 }