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

Comparing jsr166/src/jsr166y/ForkJoinPool.java (file contents):
Revision 1.107 by jsr166, Fri Jul 1 03:09:02 2011 UTC vs.
Revision 1.109 by jsr166, Fri Jul 1 18:20:11 2011 UTC

# Line 784 | Line 784 | public class ForkJoinPool extends Abstra
784          long nc = (long)(v & E_MASK) | ((c - AC_UNIT) & (AC_MASK|TC_MASK));
785          if (ctl != c || !UNSAFE.compareAndSwapLong(this, ctlOffset, c, nc)) {
786              long d = ctl; // return true if lost to a deq, to force scan
787 <            return (int)d != (int)c && ((d - c) & AC_MASK) >= 0L;
787 >            return (int)d != (int)c && (d & AC_MASK) >= (c & AC_MASK);
788          }
789          for (int sc = w.stealCount; sc != 0;) {   // accumulate stealCount
790              long s = stealCount;
# Line 1341 | Line 1341 | public class ForkJoinPool extends Abstra
1341       * @param delta 1 for increment, -1 for decrement
1342       */
1343      final void addActiveCount(int delta) {
1344 <        long d = delta < 0 ? -AC_UNIT : AC_UNIT;
1344 >        long d = (long)delta << AC_SHIFT;
1345          long c;
1346 <        do {} while (!UNSAFE.compareAndSwapLong(this, ctlOffset, c = ctl,
1347 <                                                ((c + d) & AC_MASK) |
1348 <                                                (c & ~AC_MASK)));
1346 >        do {} while (!UNSAFE.compareAndSwapLong(this, ctlOffset,
1347 >                                                c = ctl, c + d));
1348      }
1349  
1350      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines