Class MultiBinaryLongMap.ChainedLock
java.lang.Object
com.tangosol.util.MultiBinaryLongMap.ChainedLock
- All Implemented Interfaces:
Lock
- Enclosing class:
MultiBinaryLongMap
A ChainedLock is a
Lock
implementation that represents a composition
of two component locks, parent and child. All operations on this lock will
first be performed on the parent lock, and only upon successful completion
be performed on the child lock.
A ChainedLock could be used to manage multiple logical levels of concurrency control across multiple components without exposing multiple resource locks and thus imposing a locking order that reduces the possibility of introducing deadlocks.
Note: a ChainedLock could be used to represent a chain of more than two Locks by constructing a "chain of chains".
- Author:
- cp, rhl 2012-08-07
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChainedLock
(Lock lockParent, Lock lockChild) Construct a new ChainedLock composed of the specified parent and child locks. -
Method Summary
-
Field Details
-
f_lockParent
The "parent" constituent lock. -
f_lockChild
The "child" constituent lock.
-
-
Constructor Details
-
ChainedLock
-
-
Method Details
-
lock
-
lockInterruptibly
- Specified by:
lockInterruptibly
in interfaceLock
- Throws:
InterruptedException
-
tryLock
-
tryLock
- Specified by:
tryLock
in interfaceLock
- Throws:
InterruptedException
-
unlock
-
newCondition
- Specified by:
newCondition
in interfaceLock
-