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.65 by dl, Wed Dec 1 17:20:41 2010 UTC vs.
Revision 1.66 by jsr166, Wed Dec 1 19:12:53 2010 UTC

# Line 273 | Line 273 | public class Phaser {
273  
274      private static int unarrivedOf(long s) {
275          int counts = (int)s;
276 <        return (counts == EMPTY)? 0 : counts & UNARRIVED_MASK;
276 >        return (counts == EMPTY) ? 0 : counts & UNARRIVED_MASK;
277      }
278  
279      private static int partiesOf(long s) {
280          int counts = (int)s;
281 <        return (counts == EMPTY)? 0 : counts >>> PARTIES_SHIFT;
281 >        return (counts == EMPTY) ? 0 : counts >>> PARTIES_SHIFT;
282      }
283  
284      private static int phaseOf(long s) {
# Line 287 | Line 287 | public class Phaser {
287  
288      private static int arrivedOf(long s) {
289          int counts = (int)s;
290 <        return (counts == EMPTY)? 0 :
290 >        return (counts == EMPTY) ? 0 :
291              (counts >>> PARTIES_SHIFT) - (counts & UNARRIVED_MASK);
292      }
293  
# Line 411 | Line 411 | public class Phaser {
411                      break;
412              }
413              else {
414 <                synchronized(this) {                // 1st sub registration
414 >                synchronized (this) {               // 1st sub registration
415                      if (state == s) {               // recheck under lock
416                          par.doRegister(1);
417                          do {                        // force current phase
# Line 524 | Line 524 | public class Phaser {
524              this.evenQ = new AtomicReference<QNode>();
525              this.oddQ = new AtomicReference<QNode>();
526          }
527 <        this.state = (parties == 0)? ((long) EMPTY) :
527 >        this.state = (parties == 0) ? ((long) EMPTY) :
528              ((((long) phase) << PHASE_SHIFT) |
529               (((long) parties) << PARTIES_SHIFT) |
530               ((long) parties));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines