--- jsr166/src/jsr166y/CountedCompleter.java 2012/11/25 18:39:07 1.19 +++ jsr166/src/jsr166y/CountedCompleter.java 2012/11/26 05:55:05 1.25 @@ -15,11 +15,11 @@ package jsr166y; * CountedCompleter are similar to those of other completion based * components (such as {@link java.nio.channels.CompletionHandler}) * except that multiple pending completions may be necessary - * to trigger the {@link #onCompletion} action, not just one. Unless - * initialized otherwise, the {@link #getPendingCount pending count} - * starts at zero, but may be (atomically) changed using methods - * {@link #setPendingCount}, {@link #addToPendingCount}, and {@link - * #compareAndSetPendingCount}. Upon invocation of {@link + * to trigger the completion action {@link #onCompletion}, not just one. + * Unless initialized otherwise, the {@linkplain #getPendingCount pending + * count} starts at zero, but may be (atomically) changed using + * methods {@link #setPendingCount}, {@link #addToPendingCount}, and + * {@link #compareAndSetPendingCount}. Upon invocation of {@link * #tryComplete}, if the pending action count is nonzero, it is * decremented; otherwise, the completion action is performed, and if * this completer itself has a completer, the process is continued @@ -126,14 +126,14 @@ package jsr166y; * op.apply(array[lo]); * tryComplete(); * } - * } } + * }} * * This design can be improved by noticing that in the recursive case, * the task has nothing to do after forking its right task, so can * directly invoke its left task before returning. (This is an analog * of tail recursion removal.) Also, because the task returns upon * executing its left task (rather than falling through to invoke - * tryComplete) the pending count is set to one: + * {@code tryComplete}) the pending count is set to one: * *
{@code * class ForEach+ * }} * * Here, method {@code onCompletion} takes a form common to many * completion designs that combine results. This callback-style method @@ -388,7 +388,7 @@ public abstract class CountedCompleter... @@ -277,12 +277,12 @@ package jsr166y; * } * public void onCompletion(CountedCompleter> caller) { * if (caller != this) { - * MapReducer child = (MapReducer )caller; - * MapReducer sib = child.sibling; - * if (sib == null || sib.result == null) - * result = child.result; - * else - * result = reducer.apply(child.result, sib.result); + * MapReducer child = (MapReducer )caller; + * MapReducer sib = child.sibling; + * if (sib == null || sib.result == null) + * result = child.result; + * else + * result = reducer.apply(child.result, sib.result); * } * } * public E getRawResult() { return result; } @@ -291,7 +291,7 @@ package jsr166y; * return new MapReducer (null, array, mapper, reducer, * 0, array.length).invoke(); * } - * } }