Synchronization Functions


ResetEvent Function

Sets the specified event object to the nonsignaled state.

Syntax

C++
BOOL WINAPI ResetEvent(
  __in  HANDLE hEvent
);

Parameters

hEvent [in]

A handle to the event object. The CreateEvent or OpenEvent function returns this handle.

The handle must have the EVENT_MODIFY_STATE access right. For more information, see Synchronization Object Security and Access Rights.

Return Value

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.

Remarks

The state of an event object remains nonsignaled until it is explicitly set to signaled by the SetEvent or PulseEvent function. This nonsignaled state blocks the execution of any threads that have specified the event object in a call to one of the wait functions.

The ResetEvent function is used primarily for manual-reset event objects, which must be set explicitly to the nonsignaled state. Auto-reset event objects automatically change from signaled to nonsignaled after a single waiting thread is released.

Resetting an event that is already reset has no effect.

Examples

For an example that uses ResetEvent, see Using Event Objects.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

CreateEvent
Event Objects
OpenEvent
PulseEvent
SetEvent
Synchronization Functions

Send comments about this topic to Microsoft

Build date: 11/19/2009

Tags :


Community Content

dmex
vb.net syntax
<DllImport("kernel32.dll", SetLastError:=True)> _
Public Shared Function ResetEvent(ByVal handle As SafeWaitHandle) As Boolean
End Function
Tags : vb.net syntax

dmex
C# syntax
[DllImport("kernel32.dll", SetLastError=true)]
internal static extern bool ResetEvent(SafeWaitHandle handle);
Tags : c# syntax

Page view tracker