Skip to content

ReaderWriterLockSlimExtensions Class ​

Definition ​

Extension methods for type ReaderWriterLockSlim

  • Namespace: JASE.Extensions
  • Assembly: JASE.Concurrency.dll

Methods ​

NameDescription
IDisposable AcquireDisposableLock(ReaderWriterLockSlim l, LockType type, int timeout = null)Attempt to acquire a lock of the requested type in a Disposable wrapper
bool AcquireLock(ReaderWriterLockSlim l, LockType type)Attempt to acquire a lock of the requested type
bool AcquireLock(ReaderWriterLockSlim l, LockType type, int timeout)Attempt to acquire a lock of the requested type
bool HasLock(ReaderWriterLockSlim l)Check if current thread has any type of lock
bool HasLock(ReaderWriterLockSlim l, LockType type)Check if current thread has lock of specified type ReaderWriterLockSlim to use in processingType of lock to acquire
void ReleaseLock(ReaderWriterLockSlim l, LockType type)Release the requested lock type if held
void ReleaseLocks(ReaderWriterLockSlim l)Release all locks held by the current thread
bool TryAcquireLock(ReaderWriterLockSlim l, LockType type)Attempts to acquire a lock of the requested type
bool TryAcquireLock(ReaderWriterLockSlim l, LockType type, int timeout)Attempt to acquire a lock of the requested type