--- jsr166/src/jsr166y/CountedCompleter.java 2012/10/30 16:05:35 1.7 +++ jsr166/src/jsr166y/CountedCompleter.java 2012/11/14 17:20:37 1.10 @@ -142,9 +142,7 @@ package jsr166y; * * As a further improvement, notice that the left task need not even * exist. Instead of creating a new one, we can iterate using the - * original task, and add a pending count for each fork. Additionally, - * this version uses {@code helpComplete} to streamline assistance in - * the execution of forked tasks. + * original task, and add a pending count for each fork. * *
 {@code
  * class ForEach ...
@@ -158,7 +156,7 @@ package jsr166y;
  *         }
  *         if (h > l)
  *             op.apply(array[l]);
- *         helpComplete();
+ *         tryComplete();
  *     }
  * }
* @@ -414,39 +412,6 @@ public abstract class CountedCompleter a = this, s = a; - for (int c;;) { - if ((c = a.pending) == 0) { - a.onCompletion(s); - if ((a = (s = a).completer) == null) { - s.quietlyComplete(); - return; - } - } - else if (U.compareAndSwapInt(a, PENDING, c, c - 1)) { - CountedCompleter root = a.getRoot(); - Thread thread = Thread.currentThread(); - ForkJoinPool.WorkQueue wq = - (thread instanceof ForkJoinWorkerThread) ? - ((ForkJoinWorkerThread)thread).workQueue : null; - ForkJoinTask t; - while ((t = (wq != null) ? wq.popCC(root) : - ForkJoinPool.popCCFromCommonPool(root)) != null) { - t.doExec(); - if (root.isDone()) - break; - } - return; - } - } - } - - /** * Regardless of pending count, invokes {@link #onCompletion}, * marks this task as complete and further triggers {@link * #tryComplete} on this task's completer, if one exists. This @@ -512,7 +477,6 @@ public abstract class CountedCompleter