API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.concurrent. CyclicBarrier View Source
Author(s)
Doug Lea
Since
1.5
Version
Serial
Hierarchy
 Object
      CyclicBarrier
Implements
Subclasses
Description
public class CyclicBarrier
  A synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point.
See also:    CountDownLatch
Constructors
public 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.
public 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.
Methods
Hide/Show inherited methods
public int await () throws InterruptedException BrokenBarrierException
  Waits until all parties have invoked await on this barrier.
public int await (long timeout, TimeUnit unit) throws InterruptedException BrokenBarrierException TimeoutException
  Waits until all parties have invoked await on this barrier, or the specified waiting time elapses.
public int getNumberWaiting ()
  Returns the number of parties currently waiting at the barrier.
public int getParties ()
  Returns the number of parties required to trip this barrier.
public boolean isBroken ()
  Queries if this barrier is in a broken state.
public void reset ()
  Resets the barrier to its initial state.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar