public static THandle?TryAcquire <THandle>(IInternalDistributedSemaphore <THandle> @lock, TimeSpan timeout, CancellationToken cancellationToken) where THandle : class, IDistributedSynchronizationHandle => SyncViaAsync.Run( state => [email protected](state.timeout, state.cancellationToken), (@lock, timeout, cancellationToken) );
public static ValueTask <THandle> AcquireAsync <THandle>(IInternalDistributedSemaphore <THandle> @lock, TimeSpan?timeout, CancellationToken cancellationToken) where THandle : class, IDistributedSynchronizationHandle => @lock.InternalTryAcquireAsync(timeout, cancellationToken).ThrowTimeoutIfNull(@object : "semaphore");