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, syncronizedLockIsMine
public TriggeredBarrier()
public TriggeredBarrier(boolean registerAwaitingThreads)
registerAwaitingThreads
- if true, threads are registered when waitingpublic int numberWaitingThreads()
Barrier
numberWaitingThreads
in class Barrier
public void await() throws ThreadInterruptedException
Barrier
count() == old(count())+ 1
await
in interface SyncCV
await
in class Barrier
ThreadInterruptedException
public long awaitCount() throws ThreadInterruptedException
Barrier
count() == old(count())+ 1
awaitCount
in class Barrier
count
ThreadInterruptedException
public void release()
ExternalBarrier
count() == old(count())+ 1
release
in class ExternalBarrier