Class AsyncAutoResetEvent
Implements an async
/await
friendly equivalent of AutoResetEvent.
Namespace: Neon.Tasks
Assembly: Neon.Common.dll
Syntax
public class AsyncAutoResetEvent
Constructors
AsyncAutoResetEvent(bool)
Constructor.
Declaration
public AsyncAutoResetEvent(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 |
~AsyncAutoResetEvent()
Finalizer.
Declaration
protected ~AsyncAutoResetEvent()
Reset()
Sets the state of the event to unsignalled, so that tasks will have to wait.
Declaration
public void Reset()
Set()
Sets the state of the event to signalled allowing a single task that is currently waiting or the next task that waits on the event to proceed.
Declaration
public void Set()
WaitAsync()
Waits until the event is signalled.
Declaration
public NonDisposableTask WaitAsync()
Returns
Type | Description |
---|---|
NonDisposableTask |