public class TriggeredBarrier extends ExternalBarrier
release).
This class follows DbC(tm) methodology
(Wikipedia).
Where possible, contracts are implement with native's Java assert.
| Constructor and Description |
|---|
TriggeredBarrier()
Constructs a new triggered barrier registering waiting threads.
|
TriggeredBarrier(boolean registerAwaitingThreads)
Constructs a new triggered size barrier.
|
| Modifier and Type | Method and Description |
|---|---|
void |
await()
Caller will wait until the thread barrier is released, situation
in which all waiting threads are awakened.
|
long |
awaitCount()
Caller will wait until the thread barrier is released, situation
in which all waiting threads are awakened.
|
int |
numberWaitingThreads()
Number of threads currently waiting on the barrier.
|
void |
release()
Release barrier (regardless of the number of waiting threads).
|
await, await, broadcast, interruptWaitingThreads, lockIsMine, registerAwaitingThreads, signal, syncronizedLockIsMinepublic TriggeredBarrier()
public TriggeredBarrier(boolean registerAwaitingThreads)
registerAwaitingThreads - if true, threads are registered when waitingpublic int numberWaitingThreads()
BarriernumberWaitingThreads in class Barrierpublic void await()
throws ThreadInterruptedException
Barriercount() == old(count())+ 1await in interface SyncCVawait in class BarrierThreadInterruptedExceptionpublic long awaitCount()
throws ThreadInterruptedException
Barriercount() == old(count())+ 1awaitCount in class BarriercountThreadInterruptedExceptionpublic void release()
ExternalBarriercount() == old(count())+ 1release in class ExternalBarrier