|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ToolkitBarrier
A toolkit barrier that can be used to coordinate between threads in the toolkit implementation platform. Similar to
CyclicBarrier
in nature.
Consult the Toolkit class level docs for more info on behavior regarding destroy.
Method Summary | |
---|---|
int |
await()
Waits until all parties have invoked await on this barrier. |
int |
await(long timeout,
TimeUnit unit)
Waits until all parties have invoked await on this barrier, or the specified waiting time elapses. |
int |
getParties()
Returns the number of parties required to trip this barrier. |
boolean |
isBroken()
Queries if this barrier is in a broken state. |
void |
reset()
Reset to initial state. |
Methods inherited from interface org.terracotta.toolkit.object.Destroyable |
---|
destroy, isDestroyed |
Methods inherited from interface org.terracotta.toolkit.object.ToolkitObject |
---|
getName |
Method Detail |
---|
int getParties()
boolean isBroken()
true
if one or more parties broke out of this barrier due to interruption or timeout since
construction or the last reset, or a barrier action failed due to an exception; false
otherwise.int await() throws InterruptedException, BrokenBarrierException
getParties()
- 1 indicates the first
to arrive and zero indicates the last to arrive
InterruptedException
- if the current thread was interrupted while waiting
BrokenBarrierException
- if another thread was interrupted or timed out while the current thread was
waiting, or the barrier was reset, or the barrier was broken when await
was called, or the barrier
action (if present) failed due an exception.int await(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, BrokenBarrierException
timeout
- the time to wait for the barrierunit
- the time unit of the timeout parameter
getParties()
- 1 indicates the first
to arrive and zero indicates the last to arrive
InterruptedException
- if the current thread was interrupted while waiting
TimeoutException
- if the specified timeout elapses
BrokenBarrierException
- if another thread was interrupted or timed out while the current thread was
waiting, or the barrier was reset, or the barrier was broken when await
was called, or the barrier
action (if present) failed due an exceptionvoid reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |