Example usage for Java java.util.concurrent CyclicBarrier fields, constructors, methods, implement or subclass
The text is from its open source code.
CyclicBarrier(int parties) Creates a new CyclicBarrier that will trip when the given number of parties (threads) are waiting upon it, and does not perform a predefined action when the barrier is tripped. | |
CyclicBarrier(int parties, Runnable barrierAction) Creates a new CyclicBarrier that will trip when the given number of parties (threads) are waiting upon it, and which will execute the given barrier action when the barrier is tripped, performed by the last thread entering the barrier. |
int | await() Waits until all #getParties parties have invoked await on this barrier. |
int | await(long timeout, TimeUnit unit) Waits until all #getParties parties have invoked await on this barrier, or the specified waiting time elapses. |
int | getNumberWaiting() Returns the number of parties currently waiting at the barrier. |
void | reset() Resets the barrier to its initial state. |