JDK-7037436 : CR 7035020 fails to check shutdown
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.concurrent
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-04-18
  • Updated: 2011-06-08
  • Resolved: 2011-06-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b140Fixed
Related Reports
Relates :  
Description
From Doug:

I finally had a chance to re-check last FJ change (CR 7035020)
and saw that it could cause a shutdown check to be skipped.
Now really fixed. (Again, the big lesson here is: don't make
last-minute refactorings).


*** ForkJoinPool.java    2011/04/01 20:20:33    1.61
--- ForkJoinPool.java    2011/04/13 11:35:26    1.62
***************
*** 795,801 ****
              else if (w.eventCount != v)
                  return true;                      // update next time
          }
!         if ((int)c != 0 && parallelism + (int)(nc >> AC_SHIFT) == 0 &&
              blockedCount == 0 && quiescerCount == 0)
              idleAwaitWork(w, nc, c, v);           // quiescent
          for (boolean rescanned = false;;) {
--- 795,802 ----
              else if (w.eventCount != v)
                  return true;                      // update next time
          }
!         if ((!shutdown || !tryTerminate(false)) &&
!             (int)c != 0 && parallelism + (int)(nc >> AC_SHIFT) == 0 &&
              blockedCount == 0 && quiescerCount == 0)
              idleAwaitWork(w, nc, c, v);           // quiescent
          for (boolean rescanned = false;;) {

Comments
EVALUATION Thanks Doug. Some minor code style cleanups have been incorporated when sync'ing up with Doug CVS. Changeset: 603e70836e74 Author: dl Date: 2011-04-18 15:50 +0100 URL: http://hg.openjdk.java.net/jdk7/tl/jdk/rev/603e70836e74 7037436: CR 7035020 fails to check shutdown Reviewed-by: chegar ! src/share/classes/java/util/concurrent/ForkJoinPool.java ! src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java
18-04-2011