|
common-util | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlocal.tomas.util.sync.Mutex
public class Mutex
A Mutex can be used to assert mutual exclusive access to a resource. It acts as a kind of synchronized boolean switch.
| Constructor Summary | |
|---|---|
Mutex()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
lock()
Lock object. |
boolean |
trylock()
Try to lock object. |
void |
unlock()
Unlock object. |
| 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()
throws InterruptedException
SyncInterface
lock in interface SyncInterfaceInterruptedExceptionpublic boolean trylock()
SyncInterface
trylock in interface SyncInterfacepublic void unlock()
SyncInterface
unlock in interface SyncInterface
|
common-util | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||