|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjodd.util.Mutex
Class that provides fast mutual exclusion using Leslie Lamport's "Fast Mutal Exclusion" algorithm. This class does not use the built-in synchronization monitor primitives of the Java language, thus allowing for proper synchronization across method calls. Object (i.e. resource) that uses Mutex must be accessed only between lock() and unlock().
Constructor Summary | |
Mutex()
Constructor. |
Method Summary | |
boolean |
isLocked()
Probe the mutex state. |
void |
lock()
Aquire mutex. |
void |
unlock()
Release an aquired mutex. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Mutex()
Method Detail |
public void lock()
public void unlock()
public boolean isLocked()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |