mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Threading.EventWaitHandle System.Runtime.InteropServices.ComVisible(true)

AutoResetEvent allows threads to communicate with each other by signaling. Typically, you use this class when threads need exclusive access to a resource.

A thread waits for a signal by calling on the AutoResetEvent. If the AutoResetEvent is in the non-signaled state, the thread blocks, waiting for the thread that currently controls the resource to signal that the resource is available by calling .

Calling Set signals AutoResetEvent to release a waiting thread. AutoResetEvent remains signaled until a single waiting thread is released, and then automatically returns to the non-signaled state. If no threads are waiting, the state remains signaled indefinitely.

If a thread calls while the is in the signaled state, the thread does not block. The releases the thread immediately and returns to the non-signaled state.

There is no guarantee that every call to the method will release a thread. If two calls are too close together, so that the second call occurs before a thread has been released, only one thread is released. It is as if the second call did not happen. Also, if is called when there are no threads waiting and the is already signaled, the call has no effect.

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

AutoResetEvent can also be used with the static and methods.

For more information about thread synchronization mechanisms, see AutoResetEvent in the conceptual documentation.

Beginning with the .NET Framework version 2.0, derives from the new class. An is functionally equivalent to an created with .

Unlike the class, the class provides access to named system synchronization events.

Notifies a waiting thread that an event has occurred. This class cannot be inherited.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class with a Boolean value indicating whether to set the initial state to signaled.

  true to set the initial state to signaled; false to set the initial state to non-signaled.
- Method
  System.Boolean

  Starting with the dnprdnext and the compact_v35_long, this member is inherited from .

  Sets the state of the event to nonsignaled, which causes threads to block.

  true if the operation succeeds; otherwise, false.

  1.0.5000.0
- Method
  System.Boolean

  Starting with the dnprdnext and the compact_v35_long, this member is inherited from . See .

  The method releases a single thread. If there are no waiting threads, the wait handle remains signaled until a thread attempts to wait on it, or until its method is called.

  There is no guarantee that every call to the method will release a thread. If two calls are too close together, so that the second call occurs before a thread has been released, only one thread is released — as if the second call did not happen. Also, if the method is called when there are no threads waiting and the is already signaled, the call has no effect.

  Sets the state of the event to signaled, which allows at most one waiting thread to proceed.

  true if the operation succeeds; otherwise, false.

  1.0.5000.0