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) );
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();