|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Internal public interface Barrier
The barrier allows us to hold up an operation for a short while. This class is not API and should only be used for testing.
Barriers must be lowered in afinally
block so as to avoid blocking operations forever.
Method Summary | |
---|---|
void |
await()
Blocks the calling thread until the barrier is lowered or the calling thread is interrupted. |
void |
lower()
Lowers the barrier. |
String |
name()
Returns this barrier's name. |
void |
raise()
Raises the barrier. |
Method Detail |
---|
String name()
void await()
Thread.isInterrupted()
to check if the thread has been interrupted.
void raise()
await()
when the barrier is raised will block indefinitely until
the barrier is lowered again.
void lower()
await()
will no longer be blocked.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |