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

Comparing jsr166/src/jsr166e/ForkJoinPool.java (file contents):
Revision 1.62 by jsr166, Fri Jul 19 19:34:43 2013 UTC vs.
Revision 1.66 by jsr166, Thu Nov 5 16:22:39 2015 UTC

# Line 1533 | Line 1533 | public class ForkJoinPool extends Abstra
1533                       (m = ws.length - 1) < 0) { // initialize workQueues
1534                  int p = parallelism;            // find power of two table size
1535                  int n = (p > 1) ? p - 1 : 1;    // ensure at least 2 slots
1536 <                n |= n >>> 1; n |= n >>> 2;  n |= n >>> 4;
1537 <                n |= n >>> 8; n |= n >>> 16; n = (n + 1) << 1;
1536 >                n |= n >>> 1;
1537 >                n |= n >>> 2;
1538 >                n |= n >>> 4;
1539 >                n |= n >>> 8;
1540 >                n |= n >>> 16;
1541 >                n = (n + 1) << 1;
1542                  WorkQueue[] nws = ((ws = workQueues) == null || ws.length == 0 ?
1543                                     new WorkQueue[n] : null);
1544                  if (((ps = plock) & PL_LOCK) != 0 ||
# Line 1839 | Line 1843 | public class ForkJoinPool extends Abstra
1843                          }
1844                      }
1845                      for (;;) { // help stealer or descend to its stealer
1846 <                        ForkJoinTask[] a; int b;
1846 >                        ForkJoinTask<?>[] a; int b;
1847                          if (subtask.status < 0)     // surround probes with
1848                              continue restart;       //   consistency checks
1849                          if ((b = v.base) - v.top < 0 && (a = v.array) != null) {
# Line 2096 | Line 2100 | public class ForkJoinPool extends Abstra
2100                      w.currentSteal = ps;
2101                  }
2102              }
2103 <            else if (active) {       // decrement active count without queuing
2103 >            else if (active) {      // decrement active count without queuing
2104                  long nc = ((c = ctl) & ~AC_MASK) | ((c & AC_MASK) - AC_UNIT);
2105                  if ((int)(nc >> AC_SHIFT) + parallelism == 0)
2106                      break;          // bypass decrement-then-increment
# Line 2495 | Line 2499 | public class ForkJoinPool extends Abstra
2499       * minimally only the latter.
2500       *
2501       * @param task the task
2502 +     * @param <T> the type of the task's result
2503       * @return the task's result
2504       * @throws NullPointerException if the task is null
2505       * @throws RejectedExecutionException if the task cannot be
# Line 2543 | Line 2548 | public class ForkJoinPool extends Abstra
2548       * Submits a ForkJoinTask for execution.
2549       *
2550       * @param task the task to submit
2551 +     * @param <T> the type of the task's result
2552       * @return the task
2553       * @throws NullPointerException if the task is null
2554       * @throws RejectedExecutionException if the task cannot be

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines