--- jsr166/src/jsr166y/Phaser.java 2008/10/28 23:03:24 1.6 +++ jsr166/src/jsr166y/Phaser.java 2009/01/05 03:53:26 1.7 @@ -30,20 +30,20 @@ import java.lang.reflect.*; * *
Sample usages: * - *
A Phaser may be used instead of a CountdownLatch to control + *
A Phaser may be used instead of a {@code CountdownLatch} to control * a one-shot action serving a variable number of parties. The typical * idiom is for the method setting this up to first register, then * start the actions, then deregister, as in: @@ -113,7 +113,7 @@ import java.lang.reflect.*; * * *
One way to cause a set of threads to repeatedly perform actions - * for a given number of iterations is to override onAdvance: + * for a given number of iterations is to override {@code onAdvance}: * *
* void startTasks(List<Runnable> list, final int iterations) { @@ -163,7 +163,7 @@ import java.lang.reflect.*; * build(new Task[n], 0, n, new Phaser()); ** - * The best value of TASKS_PER_PHASER depends mainly on + * The best value of {@code TASKS_PER_PHASER} depends mainly on * expected barrier synchronization rates. A value as low as four may * be appropriate for extremely small per-barrier task bodies (thus * high rates), or up to hundreds for extremely large ones. @@ -508,7 +508,7 @@ public class Phaser { /** * Arrives at the barrier and awaits others. Equivalent in effect - * to awaitAdvance(arrive()). If you instead need to + * to {@code awaitAdvance(arrive())}. If you instead need to * await with interruption of timeout, and/or deregister upon * arrival, you can arrange them using analogous constructions. * @return the phase on entry to this method @@ -608,7 +608,7 @@ public class Phaser { /** * Returns the current phase number. The maximum phase number is - * Integer.MAX_VALUE, after which it restarts at + * {@code Integer.MAX_VALUE}, after which it restarts at * zero. Upon termination, the phase number is negative. * @return the phase number, or a negative value if terminated */ @@ -682,7 +682,7 @@ public class Phaser { * barrier is tripped (and thus all other waiting parties are * dormant). If it returns true, then, rather than advance the * phase number, this barrier will be set to a final termination - * state, and subsequent calls to isTerminated will + * state, and subsequent calls to {@code isTerminated} will * return true. * *
The default version returns true when the number of @@ -693,7 +693,7 @@ public class Phaser { *
You may override this method to perform an action with side * effects visible to participating tasks, but it is in general * only sensible to do so in designs where all parties register - * before any arrive, and all awaitAdvance at each phase. + * before any arrive, and all {@code awaitAdvance} at each phase. * Otherwise, you cannot ensure lack of interference. In * particular, this method may be invoked more than once per * transition if other parties successfully register while the