Property | Type | Description | |
---|---|---|---|
Factory | Func |
Property | Type | Description | |
---|---|---|---|
CancellationTokenCanceledEventHandler | void | ||
ReleaseOwnership | void | ||
TakeOwnership | void |
Method | Description | |
---|---|---|
AssertHasLock ( ) : void |
Throw an exception if the lock is not held by the calling thread.
|
|
LockHeldByMe ( ) : bool |
Determine if the lock is currently held by the calling thread.
|
|
NonReentrantLock ( bool useThisInstanceForSynchronization = false ) : System |
Constructor.
|
|
Release ( ) : void |
Exit the mutual exclusion. The calling thread must currently hold the lock. |
|
Wait ( |
Blocks the current thread until it can enter the NonReentrantLock, while observing a T:System.Threading.CancellationToken. Recursive locking is not supported. i.e. A thread may not call Wait successfully twice without an intervening Release. |
Method | Description | |
---|---|---|
CancellationTokenCanceledEventHandler ( object obj ) : void |
Callback executed when a cancellation token is canceled during a Wait.
|
|
ReleaseOwnership ( ) : void |
Release ownership of the lock. The lock must already be held by the calling thread.
|
|
TakeOwnership ( ) : void |
Take ownership of the lock (by the calling thread). The lock may not already be held by any other code.
|
public NonReentrantLock ( bool useThisInstanceForSynchronization = false ) : System | ||
useThisInstanceForSynchronization | bool | If false (the default), then the class /// allocates an internal object to be used as a sync lock. /// If true, then the sync lock object will be the NonReentrantLock instance itself. This /// saves an allocation but a client may not safely further use this instance in a call to /// Monitor.Enter/Exit or in a "lock" statement. /// |
return | System |
public Wait ( |
||
cancellationToken | The |
|
return | void |