|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsync.Mutex
Class for providing mutual exclusion of threads. Only one thread can enter critical section guarded by mutex (but can do it several times).
Constructor Summary | |
Mutex()
|
Method Summary | |
void |
enter()
Lock mutex. |
boolean |
enter(long timeout)
Try to lock mutex within specified period of time. |
void |
leave()
Release mutex. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Mutex()
Method Detail |
public void enter()
public boolean enter(long timeout)
timeout
- the maximum time to wait in milliseconds.
true
if mutex is successfully locked,
false
if enter()
was terminated
due to timeout expiration.public void leave()
leave()
invocations is equal to the number of enter()
invocations.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |