--- jsr166/src/jsr166y/Phaser.java 2009/08/23 13:37:08 1.35
+++ jsr166/src/jsr166y/Phaser.java 2009/08/23 20:12:24 1.36
@@ -31,9 +31,10 @@ import java.util.concurrent.locks.LockSu
* registered. (However, you can introduce such bookkeeping by
* subclassing this class.)
*
- *
Each generation has an associated phase value, starting at
- * zero, and advancing when all parties arrive at the barrier
- * (wrapping around to zero after reaching {@code Integer.MAX_VALUE}).
+ * Each generation has an associated phase number. The phase
+ * number starts at zero, amd advances when all parties arrive at the
+ * barrier, wrapping around to zero after reaching {@code
+ * Integer.MAX_VALUE}.
*
* Like a {@code CyclicBarrier}, a phaser may be repeatedly
* awaited. Method {@link #arriveAndAwaitAdvance} has effect
@@ -54,7 +55,6 @@ import java.util.concurrent.locks.LockSu
* when the barrier advances to a new phase.
*
*
- *
* Barrier actions, performed by the task triggering a phase
* advance, are arranged by overriding method {@link #onAdvance(int,
* int)}, which also controls termination. Overriding this method is
@@ -90,6 +90,14 @@ import java.util.concurrent.locks.LockSu
* ForkJoinPool}, which will ensure sufficient parallelism to execute
* tasks when others are blocked waiting for a phase to advance.
*
+ * The current state of a phaser may be monitored. At any given
+ * moment there are {@link #getRegisteredParties}, where {@link
+ * #getArrivedParties} have arrived at the current phase ({@link
+ * #getPhase}). When the remaining {@link #getUnarrivedParties})
+ * arrive, the phase advances. Method {@link #toString} returns
+ * snapshots of these state queries in a form convenient for
+ * informal monitoring.
+ *
*
*
* Sample usages:
@@ -666,8 +674,8 @@ public class Phaser {
}
/**
- * Returns the number of parties that have arrived at the current
- * phase of this barrier.
+ * Returns the number of registered parties that have arrived at
+ * the current phase of this barrier.
*
* @return the number of arrived parties
*/