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.202 by jsr166, Mon Jul 7 20:11:15 2014 UTC vs.
Revision 1.203 by dl, Mon Jul 7 23:19:05 2014 UTC

# Line 2137 | Line 2137 | public class ForkJoinPool extends Abstra
2137              rs = lockRunState();
2138              unlockRunState(rs, (rs & ~RSLOCK) | SHUTDOWN);
2139          }
2140 <        if ((rs & STOP) == 0) {                   // enter STOP phase
2140 >        if ((rs & STOP) == 0) {                  
2141              if (!now && (int)(ctl >> AC_SHIFT) + (config & SMASK) > 0)
2142                  return false;
2143 <            rs = lockRunState();
2143 >            WorkQueue[] ws; WorkQueue w;          // validate no submissions
2144 >            if ((ws = workQueues) != null) {
2145 >                for (int i = 0; i < ws.length; ++i) {
2146 >                    if ((w = ws[i]) != null &&
2147 >                        (!w.isEmpty() || ((i & 1) != 0 && w.scanState >= 0))) {
2148 >                        signalWork(ws, w);
2149 >                        return false;
2150 >                    }
2151 >                }
2152 >            }
2153 >            rs = lockRunState();                 // enter STOP phase
2154              unlockRunState(rs, (rs & ~RSLOCK) | STOP);
2155          }
2156          for (int pass = 0; pass < 3; ++pass) {    // clobber other workers

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines