Beispiel #1
0
 public static THandle?TryAcquire <THandle>(IInternalDistributedLock <THandle> @lock, TimeSpan timeout, CancellationToken cancellationToken)
     where THandle : class, IDistributedSynchronizationHandle =>
 SyncViaAsync.Run(
     state => [email protected](state.timeout, state.cancellationToken),
     (@lock, timeout, cancellationToken)
     );
Beispiel #2
0
 public static ValueTask <THandle> AcquireAsync <THandle>(IInternalDistributedLock <THandle> @lock, TimeSpan?timeout, CancellationToken cancellationToken)
     where THandle : class, IDistributedSynchronizationHandle =>
 @lock.InternalTryAcquireAsync(timeout, cancellationToken).ThrowTimeoutIfNull();