<PackageReference Include="Nito.AsyncEx.Coordination" Version="1.0.2" />

Nito.AsyncEx.AsyncManualResetEvent

public sealed class AsyncManualResetEvent
An async-compatible manual-reset event.
public int Id { get; }

Gets a semi-unique identifier for this asynchronous manual-reset event.

public bool IsSet { get; }

Whether this event is currently set. This member is seldom used; code using this member has a high possibility of race conditions.

public AsyncManualResetEvent(bool set)

Creates an async-compatible manual-reset event.

Creates an async-compatible manual-reset event that is initially unset.

public void Reset()

Resets the event. If the event is already reset, this method does nothing.

public void Set()

Sets the event, atomically completing every task returned by WaitAsync. If the event is already set, this method does nothing.

public void Wait()

Synchronously waits for this event to be set. This method may block the calling thread.

public void Wait(CancellationToken cancellationToken)

Synchronously waits for this event to be set. This method may block the calling thread.

public Task WaitAsync()

Asynchronously waits for this event to be set.

public Task WaitAsync(CancellationToken cancellationToken)

Asynchronously waits for this event to be set or for the wait to be canceled.