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.374 by dl, Sun Feb 16 15:13:59 2020 UTC vs.
Revision 1.375 by dl, Sun Feb 23 21:52:13 2020 UTC

# Line 1793 | Line 1793 | public class ForkJoinPool extends Abstra
1793              outer: for (;;) {
1794                  if ((s = task.status) < 0)
1795                      break;
1796 <                else if (!scan && c == (c = ctl)) {
1796 >                else if (scan = !scan) {          // previous scan was empty
1797                      if (mode < 0)
1798                          ForkJoinTask.cancelIgnoringExceptions(task);
1799 <                    else if ((s = tryCompensate(c)) >= 0)
1799 >                    else if (c == (c = ctl) && (s = tryCompensate(c)) >= 0)
1800                          break;                    // block
1801                  }
1802                  else {                            // scan for subtasks
1803                    scan = false;
1803                      WorkQueue[] qs = queues;
1804                      int n = (qs == null) ? 0 : qs.length, m = n - 1;
1805                      for (int i = n; i > 0; i -= 2, r += 2) {
# Line 1866 | Line 1865 | public class ForkJoinPool extends Abstra
1865                  }
1866                  else if ((s = task.status) < 0)
1867                      break;
1868 <                else if (!scan && c == (c = ctl))
1869 <                    break;
1868 >                else if (scan = !scan) {
1869 >                    if (c == (c = ctl))
1870 >                        break;
1871 >                }
1872                  else {                            // scan for subtasks
1872                    scan = false;
1873                      WorkQueue[] qs = queues;
1874                      int n = (qs == null) ? 0 : qs.length;
1875                      for (int i = n; i > 0; --i, ++r) {
# Line 3203 | Line 3203 | public class ForkJoinPool extends Abstra
3203              if (q < 0)
3204                  throw new InterruptedException();
3205          }
3206 <        else if (!(terminated = tryTerminate(false, false)) &&
3206 >        else if (!(terminated = ((mode & TERMINATED) != 0)) &&
3207                   (lock = registrationLock) != null) {
3208              lock.lock();
3209              try {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines