BlockingLock Class |
Namespace: Tangosol.Util
public class BlockingLock : IDisposable
The BlockingLock type exposes the following members.
| Name | Description | |
|---|---|---|
| BlockingLock |
Construct a BlockingLock.
|
| Name | Description | |
|---|---|---|
| IsLockObtained |
Whether the object was successfully locked.
|
| Name | Description | |
|---|---|---|
| Dispose |
Release the lock if it was obtained.
| |
| Enter |
Lock the object while still respecting the calling thread's ThreadTimeout.
| |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| Lock |
Construct a new BlockingLock for the specified lockObject and wait
for the lockObject to be locked while still respecting the calling
thread's ThreadTimeout.
| |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| ToString | Returns a string that represents the current object. (Inherited from Object.) | |
| TryEnter(Int32) |
Attempt to lock the object, while still respecting the calling thread's
ThreadTimeout..
| |
| TryEnter(TimeSpan) |
Attempt to lock the object, while still respecting the calling thread's
ThreadTimeout..
| |
| TryLock(Object, Int32) |
Construct a new BlockingLock for the specified lockObject and wait
for the lockObject to be locked while still respecting the calling
thread's ThreadTimeout.
| |
| TryLock(Object, TimeSpan) |
Construct a new BlockingLock for the specified lockObject and wait
for the lockObject to be locked while still respecting the calling
thread's ThreadTimeout.
|
| Name | Description | |
|---|---|---|
| f_lockObject |
The object being locked.
| |
| m_lockObtained |
Whether the object was successfully locked.
|
try { using (BlockingLock l = BlockingLock.Lock(o)) { // critical section } } catch(ThreadInterruptedException) { // handle timeout or thread interrupt }