Skip to content

TryAcquireLock Method ​

Definition ​

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

Overloads ​

NameDescription
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

bool TryAcquireLock(ReaderWriterLockSlim l, LockType type) ​

csharp
bool TryAcquireLock(ReaderWriterLockSlim l, LockType type)

Attempts 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 TryAcquireLock(ReaderWriterLockSlim l, LockType type, int timeout) ​

csharp
bool TryAcquireLock(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