DotNext.Threading by Roman Sakno

<PackageReference Include="DotNext.Threading" Version="3.2.1" />

 AsyncCounter

Represents a synchronization primitive that is signaled when its count becomes non zero.
public long Value { get; }

Gets the counter value.

public AsyncCounter(long initialValue = 0)

Initializes a new asynchronous counter.

public void Increment()

Increments counter and resume suspended callers.

public Task<bool> WaitAsync(TimeSpan timeout, CancellationToken token)

Suspends caller if Value is zero or just decrements it.