|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.excalibur.concurrent.ThreadBarrier
A thread barrier blocks all threads hitting it until a pre-defined number of threads arrive at the barrier. This is useful for implementing release consistent concurrency where you don't want to take the performance penalty of providing mutual exclusion to shared resources
Constructor Summary | |
ThreadBarrier(int count)
Initializes a thread barrier object with a given thread count |
Method Summary | |
void |
barrierSynchronize()
This method blocks all threads calling it until the threshold number of threads have called it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ThreadBarrier(int count)
pCount
- is the number of threads that need to block on
barrierSynchronize() before they will be allowed to pass throughbarrierSynchronize()
Method Detail |
public void barrierSynchronize() throws java.lang.InterruptedException
java.lang.InterruptedException
- if any thread blocked during the call is
interrupted
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |