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