Class AutoResetEvent
Notifies a waiting thread that an event has occurred. This class cannot be inherited.
Inherited Members
Namespace: System.Threading
Assembly: mscorlib.dll
Syntax
public sealed class AutoResetEvent : WaitHandle
Constructors
AutoResetEvent(bool)
Initializes a new instance of the AutoResetEvent class with a Boolean value indicating whether to set the initial state to signaled.
Declaration
public AutoResetEvent(bool initialState)
Parameters
Type | Name | Description |
---|---|---|
bool | initialState | true to set the initial state to signaled; false to set the initial state to non-signaled. |
Methods
Reset()
Sets the state of the event to nonsignaled, causing threads to block.
Declaration
public bool Reset()
Returns
Type | Description |
---|---|
bool | true if the operation succeeds; otherwise, false. |
Set()
Sets the state of the event to signaled, allowing one or more waiting threads to proceed.
Declaration
public bool Set()
Returns
Type | Description |
---|---|
bool | true if the operation succeeds; otherwise, false. |