|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.geometry.internal.MultiLock
public class MultiLock
Allows to obtain and hold up to two locks at once thus avoiding deadlocks. If it is not possible to obtain all locks at once, all locks that were previously obtained are released. After releasing all the locks, the MultiLock implementation tries to obtain all the required locks again
| Constructor Summary | |
|---|---|
MultiLock(Lock lockOne,
Lock lockTwo)
Creates a lock object and additionally obtains all given locks without risking a dead lock. |
|
| Method Summary | |
|---|---|
void |
unlock()
Unlock all locks that are held by this instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiLock(Lock lockOne,
Lock lockTwo)
You should ensure to call unlock() by using try..finally after obtaining this instance.
Null values are allowed and will be skipped.
lockOne - the primary lock to be obtained (if not null)lockTwo - the secondary lock to be obtained (if not null)| Method Detail |
|---|
public void unlock()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||