System.Threading.ManualResetEvent Class

Notifies one or more waiting threads that an event has occurred. This class cannot be inherited.

See Also: ManualResetEvent Members


public sealed class ManualResetEvent : EventWaitHandle


In the .NET Framework version 2.0, System.Threading.ManualResetEvent derives from the new System.Threading.EventWaitHandle class. A System.Threading.ManualResetEvent is functionally equivalent to an System.Threading.EventWaitHandle created with EventResetMode.ManualReset.


Unlike the System.Threading.ManualResetEvent class, the System.Threading.EventWaitHandle class provides access to named system synchronization events.

System.Threading.ManualResetEvent allows threads to communicate with each other by signaling. Typically, this communication concerns a task which one thread must complete before other threads can proceed.

When a thread begins an activity that must complete before other threads proceed, it calls EventWaitHandle.Reset to put ManualResetEvent in the non-signaled state. This thread can be thought of as controlling the ManualResetEvent. Threads that call WaitHandle.WaitOne(int, bool) on the ManualResetEvent will block, awaiting the signal. When the controlling thread completes the activity, it calls EventWaitHandle.Set to signal that the waiting threads can proceed. All waiting threads are released.

Once it has been signaled, ManualResetEvent remains signaled until it is manually reset. That is, calls to WaitOne return immediately.

You can control the initial state of a ManualResetEvent by passing a Boolean value to the constructor, true if the initial state is signaled and false otherwise.

ManualResetEvent can also be used with the static WaitHandle.WaitAll(WaitHandle[], int, bool) and WaitHandle.WaitAny(WaitHandle[], int, bool) methods.

For more information about thread synchronization mechanisms, see Manual Reset Event in the conceptual documentation.


Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0,,