ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166y/Phaser.java
(Generate patch)

Comparing jsr166/src/jsr166y/Phaser.java (file contents):
Revision 1.7 by jsr166, Mon Jan 5 03:53:26 2009 UTC vs.
Revision 1.8 by jsr166, Mon Jan 5 05:50:47 2009 UTC

# Line 84 | Line 84 | import java.lang.reflect.*;
84   *
85   * <p><b>Sample usages:</b>
86   *
87 < * <p>A Phaser may be used instead of a {@code CountdownLatch} to control
87 > * <p>A Phaser may be used instead of a {@code CountDownLatch} to control
88   * a one-shot action serving a variable number of parties. The typical
89   * idiom is for the method setting this up to first register, then
90   * start the actions, then deregister, as in:
# Line 108 | Line 108 | import java.lang.reflect.*;
108   *   int p = phaser.arriveAndDeregister(); // deregister self  ...
109   *   p = phaser.awaitAdvance(p); // ... and await arrival
110   *   otherActions(); // do other things while tasks execute
111 < *   phaser.awaitAdvance(p); // awit final completion
111 > *   phaser.awaitAdvance(p); // await final completion
112   * }
113   * </pre>
114   *
# Line 195 | Line 195 | public class Phaser {
195       * However, to efficiently maintain atomicity, these values are
196       * packed into a single (atomic) long. Termination uses the sign
197       * bit of 32 bit representation of phase, so phase is set to -1 on
198 <     * termination. Good performace relies on keeping state decoding
198 >     * termination. Good performance relies on keeping state decoding
199       * and encoding simple, and keeping race windows short.
200       *
201       * Note: there are some cheats in arrive() that rely on unarrived
# Line 541 | Line 541 | public class Phaser {
541  
542      /**
543       * Awaits the phase of the barrier to advance from the given
544 <     * value, or returns immediately if argumet is negative or this
544 >     * value, or returns immediately if argument is negative or this
545       * barrier is terminated, or throws InterruptedException if
546       * interrupted while waiting.
547       * @param phase the phase on entry to this method

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines