Esempio n. 1
0
 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)
     );
Esempio n. 2
0
 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)
     );
Esempio n. 3
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)
     );
Esempio n. 4
0
 public static bool TryUpgradeToWriteLock(IDistributedLockUpgradeableHandle handle, TimeSpan timeout, CancellationToken cancellationToken) =>
 SyncViaAsync.Run(t => t.handle.TryUpgradeToWriteLockAsync(t.timeout, t.cancellationToken), (handle, timeout, cancellationToken));