Method TryEnterWriteGuard
TryEnterWriteGuard()
Tries to enter the lock in write mode without waiting and returns a guard whose IsEntered property says whether it did. Disposing the guard leaves the lock, or does nothing if the lock was not entered.
Declaration
public AsyncWriteGuard TryEnterWriteGuard()
Returns
| Type | Description |
|---|---|
| AsyncWriteGuard |
Remarks
The lock is entered if it is not held in either mode and nothing is waiting for it. The call allocates nothing.
The lock is not reentrant, but this call never waits for it: if the caller already holds the lock in either mode, the call returns a guard that did not enter it.