Suspend execution until an event is signalled.
int WaitForSingleEvent (EVENT e, int ms);
Required Header |
<process.h> |
Return Value
WAIT_FAILED is returned and errno set to the specific reason on failures. WAIT_TIMEOUT is returned if the EVENT was not signalled by the time specified. WAIT_OBJECT_0 is returned if the EVENT was already signalled or was signalled within the time limit specified.
Parameters
e
The EVENT object to wait on.
ms
The length of time to wait in milliseconds, use INFINITE for no time limit.
Remarks
The WaitForSingleEvent function suspends execution of the calling thread if the EVENT object is not currently signalled. The thread will wake up if the EVENT is signalled with the SetEvent function, or if the CloseEvent function is called for the EVENT passed as the parameter. The thread will also wake up if the time limit expires before the EVENT is signalled.
See Also _beginthread, _endthread, _syncthread, CreateEvent, ResetEvent, SetEvent, EventStatus, WaitForMultipleEvents, CloseEvent