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.17 by jsr166, Thu Jul 23 19:25:45 2009 UTC vs.
Revision 1.18 by jsr166, Thu Jul 23 23:07:57 2009 UTC

# Line 211 | Line 211 | public class Phaser {
211      private static final int phaseMask  = 0x7fffffff;
212  
213      private static int unarrivedOf(long s) {
214 <        return (int)(s & ushortMask);
214 >        return (int) (s & ushortMask);
215      }
216  
217      private static int partiesOf(long s) {
# Line 266 | Line 266 | public class Phaser {
266      private final AtomicReference<QNode> oddQ  = new AtomicReference<QNode>();
267  
268      private AtomicReference<QNode> queueFor(int phase) {
269 <        return (phase & 1) == 0? evenQ : oddQ;
269 >        return ((phase & 1) == 0) ? evenQ : oddQ;
270      }
271  
272      /**
# Line 274 | Line 274 | public class Phaser {
274       * root if necessary.
275       */
276      private long getReconciledState() {
277 <        return parent == null? state : reconcileState();
277 >        return (parent == null) ? state : reconcileState();
278      }
279  
280      /**
# Line 441 | Line 441 | public class Phaser {
441                  if (par == null) {      // directly trip
442                      if (casState
443                          (s,
444 <                         trippedStateFor(onAdvance(phase, parties)? -1 :
444 >                         trippedStateFor(onAdvance(phase, parties) ? -1 :
445                                           ((phase + 1) & phaseMask), parties))) {
446                          releaseWaiters(phase);
447                          break;
# Line 502 | Line 502 | public class Phaser {
502                  if (unarrived == 0) {
503                      if (casState
504                          (s,
505 <                         trippedStateFor(onAdvance(phase, parties)? -1 :
505 >                         trippedStateFor(onAdvance(phase, parties) ? -1 :
506                                           ((phase + 1) & phaseMask), parties))) {
507                          releaseWaiters(phase);
508                          break;
# Line 587 | Line 587 | public class Phaser {
587       * @throws InterruptedException if thread interrupted while waiting
588       * @throws TimeoutException if timed out while waiting
589       */
590 <    public int awaitAdvanceInterruptibly(int phase, long timeout, TimeUnit unit)
590 >    public int awaitAdvanceInterruptibly(int phase,
591 >                                         long timeout, TimeUnit unit)
592          throws InterruptedException, TimeoutException {
593          if (phase < 0)
594              return phase;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines