--- jsr166/src/jsr166y/Phaser.java 2009/08/08 19:36:52 1.27 +++ jsr166/src/jsr166y/Phaser.java 2009/08/19 17:44:45 1.32 @@ -169,7 +169,7 @@ import java.util.concurrent.locks.LockSu * *

Implementation notes: This implementation restricts the * maximum number of parties to 65535. Attempts to register additional - * parties result in IllegalStateExceptions. However, you can and + * parties result in {@code IllegalStateException}. However, you can and * should create tiered phasers to accommodate arbitrarily large sets * of participants. * @@ -535,9 +535,9 @@ public class Phaser { /** * Awaits the phase of the barrier to advance from the given phase - * value, or returns immediately if current phase of the barrier - * is not equal to the given phase value or this barrier is - * terminated. + * value, returning immediately if the current phase of the + * barrier is not equal to the given phase value or this barrier + * is terminated. * * @param phase the phase on entry to this method * @return the phase on exit from this method @@ -556,10 +556,11 @@ public class Phaser { } /** - * Awaits the phase of the barrier to advance from the given - * value, or returns immediately if argument is negative or this - * barrier is terminated, or throws InterruptedException if - * interrupted while waiting. + * Awaits the phase of the barrier to advance from the given phase + * value, throwing {@code InterruptedException} if interrupted while + * waiting, or returning immediately if the current phase of the + * barrier is not equal to the given phase value or this barrier + * is terminated. * * @param phase the phase on entry to this method * @return the phase on exit from this method @@ -579,11 +580,17 @@ public class Phaser { } /** - * Awaits the phase of the barrier to advance from the given value - * or the given timeout elapses, or returns immediately if - * argument is negative or this barrier is terminated. + * Awaits the phase of the barrier to advance from the given phase + * value or the given timeout to elapse, throwing + * {@code InterruptedException} if interrupted while waiting, or + * returning immediately if the current phase of the barrier is not + * equal to the given phase value or this barrier is terminated. * * @param phase the phase on entry to this method + * @param timeout how long to wait before giving up, in units of + * {@code unit} + * @param unit a {@code TimeUnit} determining how to interpret the + * {@code timeout} parameter * @return the phase on exit from this method * @throws InterruptedException if thread interrupted while waiting * @throws TimeoutException if timed out while waiting @@ -713,7 +720,7 @@ public class Phaser { * only sensible to do so in designs where all parties register * before any arrive, and all {@link #awaitAdvance} at each phase. * Otherwise, you cannot ensure lack of interference from other - * parties during the the invocation of this method. + * parties during the invocation of this method. * * @param phase the phase number on entering the barrier * @param registeredParties the current number of registered parties