|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpt.ua.concurrent.CObject
pt.ua.concurrent.FixedBarrier
public class FixedBarrier
A fixed sized thread barrier class.
This class follows DbC(tm) methodology
(Wikipedia).
Where possible, contracts are implement with native's Java
assert.
Constructor Summary | |
---|---|
FixedBarrier(int size)
Constructs a new fixed size barrier for size threads registering waiting threads. |
|
FixedBarrier(int size,
boolean registerAwaitingThreads)
Constructs a new fixed size barrier for size threads. |
Method Summary | |
---|---|
void |
await()
Object's wait replacement, in which: - the checked exception InterruptedException, is replaced by the unchecked exception ThreadInterruptedException; - supports the registration of waiting threads for interrupt purposes. |
int |
numberWaitingThreads()
Number of threads currently waiting on the barrier. |
void |
setSize(int size)
Define a new size for the barrier. |
int |
size()
Number of threads defined for the barrier. |
Methods inherited from class pt.ua.concurrent.CObject |
---|
await, await, broadcast, interruptWaitingThreads, lockIsMine, registerAwaitingThreads, signal, syncronizedLockIsMine |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FixedBarrier(int size)
size
threads registering waiting threads.
size > 0
size
- barrier's number of threadspublic FixedBarrier(int size, boolean registerAwaitingThreads)
size
threads.
size > 0
size
- barrier's number of threadsregisterAwaitingThreads
- if true, threads are registered when waitingMethod Detail |
---|
public void setSize(int size)
size > 0
size
- barrier's number of threadspublic int size()
Barrier
size
in interface Barrier
public int numberWaitingThreads()
Barrier
numberWaitingThreads
in interface Barrier
public void await() throws ThreadInterruptedException
CObject
syncronizedLockIsMine()
- native lock owned by me
await
in interface Barrier
await
in interface SyncCV
await
in class CObject
ThreadInterruptedException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |