Skip to content

AcquireLock Method ​

Definition ​

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

Overloads ​

NameDescription
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 AcquireLock(ReaderWriterLockSlim l, LockType type) ​

csharp
bool AcquireLock(ReaderWriterLockSlim l, LockType type)

Attempt to acquire a lock of the requested type

Parameters ​

NameDescription
lReaderWriterLockSlim to use in processing
typeType of lock to acquire

Returns ​

Boolean true if a lock was acquired, otherwise false

bool AcquireLock(ReaderWriterLockSlim l, LockType type, int timeout) ​

csharp
bool AcquireLock(ReaderWriterLockSlim l, LockType type, int timeout)

Attempt to acquire a lock of the requested type

Parameters ​

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

Returns ​

Boolean true if a lock was acquired, otherwise false