![]() | MonitorLock Class |
lock( object ) { ... }
if (Monitor.TryEnter(object, timeout)) { try { ... } finally { Monitor.Exit(object); } }
using(lockObj.Acquire()) {
...
}
MonitorLock allows users to specify events that can be consumed on lock acquisition or release. Additionally, it can inform you when a lock is acquired within an existing lock. And last, if you want to know where your locks are being acquired, it can maintain a StackTrace of points where allocations are occuring.
Namespace: com.espertech.esper.compat.threading.locks
public class MonitorLock : ILockable
The MonitorLock type exposes the following members.
Name | Description | |
---|---|---|
![]() | MonitorLock |
Initializes a new instance of the MonitorLock class.
|
![]() | MonitorLock(Int32) |
Initializes a new instance of the MonitorLock class.
|
Name | Description | |
---|---|---|
![]() | IsHeldByCurrentThread |
Gets a value indicating whether this instance is held by current thread.
|
![]() | LockDepth |
Gets the lock depth.
|
![]() | LockTimeout |
Gets the number of milliseconds until the lock acquisition fails.
|
Name | Description | |
---|---|---|
![]() | Acquire |
Acquires a lock against this instance.
|
![]() | Acquire(Int64) | |
![]() | Acquire(Boolean, NullableT) | |
![]() | Release |
Releases this instance.
|
![]() | ReleaseAcquire | |
![]() | ToString |
Name | Description | |
---|---|---|
![]() | Call(Action) | Overloaded.
Executes an observable call within the scope of the lock.
(Defined by LockableExtensions.) |
![]() | CallT(FuncTResult) | Overloaded. (Defined by LockableExtensions.) |