Skip to content

AcquireDisposableLock Method ​

Definition ​

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

IDisposable AcquireDisposableLock(ReaderWriterLockSlim l, LockType type, int timeout = null) ​

csharp
IDisposable AcquireDisposableLock(ReaderWriterLockSlim l, LockType type, int timeout = null)

Attempt to acquire a lock of the requested type in a Disposable wrapper

Parameters ​

NameDescription
lReaderWriterLockSlim to use in processing
timeoutTimeout in milliseconds to wait for acquiring the lock
typeType of lock to acquire

Returns ​

IDisposable if a lock was acquired, otherwise null