This topic is now archived and is closed to further replies.



Recommended Posts

What does exactly do the WaitForSingleObject function? I''ve been looking for that in msdn but I couldn''t find an exact explanation. thnx.

Share this post

Link to post
Share on other sites
From MSDN:
The WaitForSingleObject function checks the current state of the specified object. If the object''s state is nonsignaled, the calling thread enters an efficient wait state. The thread consumes very little processor time while waiting for the object state to become signaled or the time-out interval to elapse.

Before returning, a wait function modifies the state of some types of synchronization objects. Modification occurs only for the object whose signaled state caused the function to return. For example, the count of a semaphore object is decreased by one.

WaitForSingleObject waits until an object is in a non-signalled mode (ie, no other thread can claim "ownership" of it, meaning it is safe to access and modify).

I wanna work for Microsoft!
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!

Share this post

Link to post
Share on other sites