AsyncReaderWriterLock
Represents asynchronous version of ReaderWriterLockSlim.
Represents lock stamp used for optimistic reading.
Gets the total number of unique readers.
Gets a value that indicates whether the read lock taken.
Gets a value that indicates whether the write lock taken.
Initializes a new reader/writer lock.
public AsyncReaderWriterLock()
Initializes a new reader/writer lock.
Downgrades the write lock to the read lock.
Enters the lock in read mode asynchronously.
Enters the lock in read mode asynchronously.
Enters the lock in write mode asynchronously.
Enters the lock in write mode asynchronously.
Exits previously acquired mode.
public ValueTask StealWriteLockAsync(object reason, TimeSpan timeout, CancellationToken token = default)
Interrupts all pending callers in the queue and acquires write lock.
Interrupts all pending callers in the queue and acquires write lock.
Attempts to obtain reader lock synchronously without blocking caller thread.
Tries to enter the lock in read mode asynchronously, with an optional time-out.
Attempts to acquire write lock without blocking.
Attempts to obtain writer lock synchronously without blocking caller thread.
Tries to enter the lock in write mode asynchronously, with an optional time-out.
Returns a stamp that can be validated later.
public ValueTask<bool> TryStealWriteLockAsync(object reason, TimeSpan timeout, CancellationToken token = default)
Interrupts all pending callers in the queue and acquires write lock.
Tries to upgrade the read lock to the write lock synchronously without blocking of the caller.
public ValueTask<bool> TryUpgradeToWriteLockAsync(TimeSpan timeout, CancellationToken token = default)
Tries to upgrade the read lock to the write lock asynchronously.
Upgrades the read lock to the write lock asynchronously.
Upgrades the read lock to the write lock asynchronously.
Returns true if the lock has not been exclusively acquired since issuance of the given stamp.