public final class ConditionVariable
extends java.lang.Object
| Constructor and Description |
|---|
ConditionVariable() |
| Modifier and Type | Method and Description |
|---|---|
void |
block()
Blocks until the condition is opened.
|
boolean |
block(long timeout)
Blocks until the condition is opened or until
timeout milliseconds have passed. |
boolean |
close()
Closes the condition.
|
boolean |
open()
Opens the condition and releases all threads that are blocked.
|
public boolean open()
public boolean close()
public void block()
throws java.lang.InterruptedException
java.lang.InterruptedException - If the thread is interrupted.public boolean block(long timeout)
throws java.lang.InterruptedException
timeout milliseconds have passed.timeout - The maximum time to wait in milliseconds.java.lang.InterruptedException - If the thread is interrupted.