|
common-util | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlocal.tomas.util.sync.Condition
public class Condition
A Condition is used to exchange the state of a boolean condition between threads. A Mutex is used for synchronization. This mutex can be either passed to the constructor or a default one created internally.
Mutex| Constructor Summary | |
|---|---|
Condition()
Construct condition with internal mutex. |
|
Condition(Mutex mutex)
Construct condition with specific mutex. |
|
| Method Summary | |
|---|---|
void |
conditionNotify()
Notify condition has been met. |
void |
conditionNotifyAll()
Notify all threads that condition has been met. |
void |
conditionWait()
Wait until condition has been met. |
void |
lock()
|
boolean |
trylock()
|
void |
unlock()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Condition(Mutex mutex)
mutex - the mutexpublic Condition()
| Method Detail |
|---|
public void conditionWait()
throws InterruptedException
InterruptedExceptionpublic void conditionNotify()
public void conditionNotifyAll()
public void lock()
throws InterruptedException
InterruptedException
public boolean trylock()
throws InterruptedException
InterruptedExceptionpublic void unlock()
|
common-util | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||