|
||||||||
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.DynamicBarrier
public class DynamicBarrier
A dynamically sized thread barrier class.
This class follows DbC(tm) methodology
(Wikipedia).
Where possible, contracts are implement with native's Java
assert.
Constructor Summary | |
---|---|
DynamicBarrier()
Constructs a new dynamic barrier registering waiting threads. |
|
DynamicBarrier(boolean registerAwaitingThreads)
Constructs a new dynamic barrier. |
Method Summary | |
---|---|
void |
await()
Caller will wait until all signed barrier threads are also waiting, situation in which all of them are awakened. |
boolean |
isSignIn()
Is current thread registered in barrier? |
int |
numberWaitingThreads()
Number of threads currently waiting on the barrier. |
void |
signIn()
Add signature of current thread in the barrier. |
void |
signOut()
Remove signature of current thread in 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 DynamicBarrier()
public DynamicBarrier(boolean registerAwaitingThreads)
registerAwaitingThreads
- if true, threads are registered when waitingMethod Detail |
---|
public boolean isSignIn()
public void signIn()
!isSignIn()
isSignIn()
public void signOut()
isSignIn()
!isSignIn()
public int size()
Barrier
size
in interface Barrier
public int numberWaitingThreads()
Barrier
numberWaitingThreads
in interface Barrier
public void await() throws ThreadInterruptedException
isSignIn()
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 |