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

Nito.AsyncEx.AsyncCountdownEvent

public sealed class AsyncCountdownEvent
An async-compatible countdown event.
public long CurrentCount { get; }

Gets the current number of remaining signals before this event becomes set. This member is seldom used; code using this member has a high possibility of race conditions.

public int Id { get; }

Gets a semi-unique identifier for this asynchronous countdown event.

public AsyncCountdownEvent(long count)

Creates an async-compatible countdown event.

public void AddCount(long addCount)

Adds the specified value to the current count.

public void AddCount()

Adds one to the current count.

public void Signal(long signalCount)

Subtracts the specified value from the current count.

public void Signal()

Subtracts one from the current count.

public void Wait()

Synchronously waits for the count to reach zero. This method may block the calling thread.

public void Wait(CancellationToken cancellationToken)

Synchronously waits for the count to reach zero. This method may block the calling thread.

public Task WaitAsync()

Asynchronously waits for the count to reach zero.

public Task WaitAsync(CancellationToken cancellationToken)

Synchronously waits for the count to reach zero. This method may block the calling thread.