Don't use sleep().  Use WaitForSingleObject() instead with a timeout equal 
to the number of seconds you want to sleep.
Wait on an event that is never signaled unless your thread is being 
terminated.

HANDLE hSleepEvent = CreateEvent(NULL, FALSE, FALSE, NULL);

//Here's how you do the sleep
WaitForSingleObject(hSleepEvent, 5000); //Wait for entire 5 seconds or 
until the event is signaled.

//Here's how to wake up the sleeper
SetEvent(hSleepEvent);

//Don't forget to do this when you are done with the handle.
CloseHandle(hSleepEvent);

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to