ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/CyclicBarrier.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/CyclicBarrier.java (file contents):
Revision 1.44 by jsr166, Sun Jan 13 21:03:20 2013 UTC vs.
Revision 1.45 by jsr166, Wed Jan 16 01:59:47 2013 UTC

# Line 16 | Line 16 | import java.util.concurrent.locks.Reentr
16   * <em>cyclic</em> because it can be re-used after the waiting threads
17   * are released.
18   *
19 < * <p>A <tt>CyclicBarrier</tt> supports an optional {@link Runnable} command
19 > * <p>A {@code CyclicBarrier} supports an optional {@link Runnable} command
20   * that is run once per barrier point, after the last thread in the party
21   * arrives, but before any threads are released.
22   * This <em>barrier action</em> is useful
# Line 73 | Line 73 | import java.util.concurrent.locks.Reentr
73   * barrier until all rows have been processed. When all rows are processed
74   * the supplied {@link Runnable} barrier action is executed and merges the
75   * rows. If the merger
76 < * determines that a solution has been found then <tt>done()</tt> will return
77 < * <tt>true</tt> and each worker will terminate.
76 > * determines that a solution has been found then {@code done()} will return
77 > * {@code true} and each worker will terminate.
78   *
79   * <p>If the barrier action does not rely on the parties being suspended when
80   * it is executed, then any of the threads in the party could execute that
# Line 87 | Line 87 | import java.util.concurrent.locks.Reentr
87   *   // log the completion of this iteration
88   * }}</pre>
89   *
90 < * <p>The <tt>CyclicBarrier</tt> uses an all-or-none breakage model
90 > * <p>The {@code CyclicBarrier} uses an all-or-none breakage model
91   * for failed synchronization attempts: If a thread leaves a barrier
92   * point prematurely because of interruption, failure, or timeout, all
93   * other threads waiting at that barrier point will also leave
# Line 114 | Line 114 | public class CyclicBarrier {
114       * is reset. There can be many generations associated with threads
115       * using the barrier - due to the non-deterministic way the lock
116       * may be allocated to waiting threads - but only one of these
117 <     * can be active at a time (the one to which <tt>count</tt> applies)
117 >     * can be active at a time (the one to which {@code count} applies)
118       * and all the rest are either broken or tripped.
119       * There need not be an active generation if there has been a break
120       * but no subsequent reset.
# Line 234 | Line 234 | public class CyclicBarrier {
234      }
235  
236      /**
237 <     * Creates a new <tt>CyclicBarrier</tt> that will trip when the
237 >     * Creates a new {@code CyclicBarrier} that will trip when the
238       * given number of parties (threads) are waiting upon it, and which
239       * will execute the given barrier action when the barrier is tripped,
240       * performed by the last thread entering the barrier.
# Line 253 | Line 253 | public class CyclicBarrier {
253      }
254  
255      /**
256 <     * Creates a new <tt>CyclicBarrier</tt> that will trip when the
256 >     * Creates a new {@code CyclicBarrier} that will trip when the
257       * given number of parties (threads) are waiting upon it, and
258       * does not perform a predefined action when the barrier is tripped.
259       *
# Line 276 | Line 276 | public class CyclicBarrier {
276  
277      /**
278       * Waits until all {@linkplain #getParties parties} have invoked
279 <     * <tt>await</tt> on this barrier.
279 >     * {@code await} on this barrier.
280       *
281       * <p>If the current thread is not the last to arrive then it is
282       * disabled for thread scheduling purposes and lies dormant until
# Line 301 | Line 301 | public class CyclicBarrier {
301       *
302       * <p>If the barrier is {@link #reset} while any thread is waiting,
303       * or if the barrier {@linkplain #isBroken is broken} when
304 <     * <tt>await</tt> is invoked, or while any thread is waiting, then
304 >     * {@code await} is invoked, or while any thread is waiting, then
305       * {@link BrokenBarrierException} is thrown.
306       *
307       * <p>If any thread is {@linkplain Thread#interrupt interrupted} while waiting,
# Line 338 | Line 338 | public class CyclicBarrier {
338  
339      /**
340       * Waits until all {@linkplain #getParties parties} have invoked
341 <     * <tt>await</tt> on this barrier, or the specified waiting time elapses.
341 >     * {@code await} on this barrier, or the specified waiting time elapses.
342       *
343       * <p>If the current thread is not the last to arrive then it is
344       * disabled for thread scheduling purposes and lies dormant until
# Line 368 | Line 368 | public class CyclicBarrier {
368       *
369       * <p>If the barrier is {@link #reset} while any thread is waiting,
370       * or if the barrier {@linkplain #isBroken is broken} when
371 <     * <tt>await</tt> is invoked, or while any thread is waiting, then
371 >     * {@code await} is invoked, or while any thread is waiting, then
372       * {@link BrokenBarrierException} is thrown.
373       *
374       * <p>If any thread is {@linkplain Thread#interrupt interrupted} while

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines