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

Comparing jsr166/src/main/java/util/concurrent/ForkJoinPool.java (file contents):
Revision 1.279 by jsr166, Sun Sep 20 17:03:22 2015 UTC vs.
Revision 1.280 by dl, Sat Sep 26 15:30:15 2015 UTC

# Line 1781 | Line 1781 | public class ForkJoinPool extends Abstra
1781                  if (w.scanState < 0) {           // recheck after write
1782                      LockSupport.park(this);
1783                      if ((stat = w.qlock) >= 0 && w.scanState < 0) {
1784 <                        Thread.interrupted();    // clear status
1785 <                        LockSupport.park(this);  // retry once
1784 >                        Thread.interrupted();    // clear status and retry once
1785 >                        if ((runState & STOP) != 0)
1786 >                            stat = w.qlock = -1;
1787 >                        else
1788 >                            LockSupport.park(this);
1789                      }
1790                  }
1791                  w.parker = null;
# Line 1825 | Line 1828 | public class ForkJoinPool extends Abstra
1828                          int cfg = w.config, idx = cfg & SMASK;
1829                          long nc = ((UC_MASK & (c - TC_UNIT)) |
1830                                     (SP_MASK & w.stackPred));
1831 <                        if ((ws = workQueues) != null &&
1831 >                        if ((runState & STOP) == 0 &&
1832 >                            (ws = workQueues) != null &&
1833                              idx < ws.length && idx >= 0 && ws[idx] == w &&
1834                              U.compareAndSwapLong(this, CTL, c, nc)) {
1835                              ws[idx] = null;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines