Struct AsyncManualResetEvent
Represents an asynchronous thread synchronization event that, when signaled, must be reset manually. This event supports at most one active awaiter.
public readonly struct AsyncManualResetEvent : IDisposable
- Implements
- Inherited Members
Properties
Owner
Specifies ValueTaskDelaySource instance that backs this manual reset event.
public ValueTaskDelaySource? Owner { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Remarks
Causes awaited task to return Disposed result.
Reset()
Sets the state of this manual reset event to non-signaled, which causes awaited task to not complete.
public bool Reset()
Returns
- bool
true, when operation was successful, otherwise false.
Set()
Sets the state of this manual reset event to signaled, which causes awaited task to return Signaled result.
public bool Set()
Returns
- bool
true, when operation was successful, otherwise false.
WaitAsync(Duration?)
Creates a new task that does not complete until this manual reset event is set.
public ValueTask<AsyncManualResetEventResult> WaitAsync(Duration? delay = null)
Parameters
delayDuration?Optional wait timeout. Disabled by default.
Returns
- ValueTask<AsyncManualResetEventResult>
New ValueTask<TResult> instance which returns a AsyncManualResetEventResult value.
Remarks
Returned task will complete immediately, when this event is already signaled or disposed or being awaited by another task.