public abstract class Barrier extends CObject
numberWaitingThreads() >= 0This class follows DbC(tm) methodology
(Wikipedia).
Where possible, contracts are implement with native's Java assert.
| Constructor and Description |
|---|
Barrier()
Constructs a new barrier registering waiting threads.
|
Barrier(boolean registerAwaitingThreads)
Constructs a new barrier.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
await()
Caller will wait until the thread barrier is released, situation
in which all waiting threads are awakened.
|
abstract long |
awaitCount()
Caller will wait until the thread barrier is released, situation
in which all waiting threads are awakened.
|
long |
count()
Number of times the barrier was released (to be more precise: the remainder
of the integer division for 2^63)
|
abstract int |
numberWaitingThreads()
Number of threads currently waiting on the barrier.
|
await, await, broadcast, interruptWaitingThreads, lockIsMine, registerAwaitingThreads, signal, syncronizedLockIsMinepublic Barrier()
public Barrier(boolean registerAwaitingThreads)
registerAwaitingThreads - if true, threads are registered when waitingpublic abstract int numberWaitingThreads()
public abstract void await()
throws ThreadInterruptedException
count() == old(count())+ 1await in interface SyncCVawait in class CObjectThreadInterruptedExceptionpublic abstract long awaitCount()
throws ThreadInterruptedException
count() == old(count())+ 1countThreadInterruptedExceptionpublic long count()
count