public static TUpgradeableHandle AcquireUpgradeableReadLock <THandle, TUpgradeableHandle>(IInternalDistributedUpgradeableReaderWriterLock <THandle, TUpgradeableHandle> @lock, TimeSpan?timeout, CancellationToken cancellationToken) where THandle : class, IDistributedSynchronizationHandle where TUpgradeableHandle : class, IDistributedLockUpgradeableHandle => SyncViaAsync.Run( state => AcquireUpgradeableReadLockAsync(state.@lock, state.timeout, state.cancellationToken), (@lock, timeout, cancellationToken) );
public static THandle Acquire <THandle>(IInternalDistributedLock <THandle> @lock, TimeSpan?timeout, CancellationToken cancellationToken) where THandle : class, IDistributedSynchronizationHandle => SyncViaAsync.Run( state => AcquireAsync(state.@lock, state.timeout, state.cancellationToken), (@lock, timeout, cancellationToken) );
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 bool TryUpgradeToWriteLock(IDistributedLockUpgradeableHandle handle, TimeSpan timeout, CancellationToken cancellationToken) => SyncViaAsync.Run(t => t.handle.TryUpgradeToWriteLockAsync(t.timeout, t.cancellationToken), (handle, timeout, cancellationToken));