<PackageReference Include="Nito.AsyncEx.Coordination" Version="5.0.0-pre-06" />

Nito.AsyncEx.AsyncWaitQueueExtensions

public static class AsyncWaitQueueExtensions
Provides extension methods for wait queues.
public static Task<T> Enqueue<T>(this IAsyncWaitQueue<T> this, object mutex, CancellationToken token)

Creates a new entry and queues it to this wait queue. If the cancellation token is already canceled, this method immediately returns a canceled task without modifying the wait queue.