Class AsyncManualResetEvent
Implements an async
/await
friendly equivalent of ManualResetEvent.
Namespace: Neon.Tasks
Assembly: Neon.Common.dll
Syntax
public class AsyncManualResetEvent
Constructors
AsyncManualResetEvent(bool)
Constructor.
Declaration
public AsyncManualResetEvent(bool initialState = false)
Parameters
Type | Name | Description |
---|---|---|
bool | initialState | Pass |
Methods
Close()
Releases any important resources associated with the instance.
Declaration
public void Close()
Remarks
note
This method will cause a ObjectDisposedException to be thrown on any task waiting on this event.
Dispose()
Releases any important resources associated with the instance.
Declaration
public void Dispose()
Remarks
note
This method will cause a ObjectDisposedException to be thrown on any task waiting on this event.
Dispose(bool)
Releases any important resources associated with the instance.
Declaration
protected void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | Pass |
~AsyncManualResetEvent()
Finalizer.
Declaration
protected ~AsyncManualResetEvent()
Reset()
Sets the state of the event to non-signalled, causing tasks to block.
Declaration
public void Reset()
Set()
Sets the state of the event to signalled allowing one or more waiting tasks to proceed.
Declaration
public void Set()
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Thrown if the event has already been closed. |
WaitAsync()
Wait asynchronously for the event to be signalled.
Declaration
public NonDisposableTask WaitAsync()
Returns
Type | Description |
---|---|
NonDisposableTask |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Thrown if the event has already been closed or is closed before it is signalled. |