Method Obtain
Obtain()
Attempts to obtain exclusive access and immediately return upon success or failure. Use Dispose() to release the lock.
Declaration
public abstract bool Obtain()
Returns
Type | Description |
---|---|
System.Boolean | true iff exclusive access is obtained |
Obtain(Int64)
Attempts to obtain an exclusive lock within amount of
time given. Polls once per LOCK_POLL_INTERVAL
(currently 1000) milliseconds until lockWaitTimeout
is
passed.
Declaration
public bool Obtain(long lockWaitTimeout)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | lockWaitTimeout | length of time to wait in milliseconds or LOCK_OBTAIN_WAIT_FOREVER to retry forever |
Returns
Type | Description |
---|---|
System.Boolean |
|
Exceptions
Type | Condition |
---|---|
LockObtainFailedException | if lock wait times out |