Platform SDK: DLLs, Processes, and Threads |
The SetEvent function sets the specified event object to the signaled state.
BOOL SetEvent( HANDLE hEvent // handle to event );
Windows NT/2000: The handle must have EVENT_MODIFY_STATE access. For more information, see Synchronization Object Security and Access Rights.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The state of a manual-reset event object remains signaled until it is set explicitly to the nonsignaled state by the ResetEvent function. Any number of waiting threads, or threads that subsequently begin wait operations for the specified event object by calling one of the wait functions, can be released while the object's state is signaled.
The state of an auto-reset event object remains signaled until a single waiting thread is released, at which time the system automatically sets the state to nonsignaled. If no threads are waiting, the event object's state remains signaled.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Synchronization Overview, Synchronization Functions, CreateEvent, OpenEvent, PulseEvent, ResetEvent