--- jsr166/src/test/loops/BinaryAsyncAction.java 2010/09/19 12:55:36 1.1 +++ jsr166/src/test/loops/BinaryAsyncAction.java 2012/11/18 18:03:11 1.7 @@ -1,7 +1,7 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * + * http://creativecommons.org/publicdomain/zero/1.0/ */ import java.util.concurrent.*; @@ -15,11 +15,11 @@ import java.util.concurrent.atomic.*; * BinaryAsyncActions are simpler to use and have less overhead in * typical uasges but are restricted to binary computation trees. * - *
Upon construction, an BinaryAsyncAction does not bear any + *
Upon construction, an BinaryAsyncAction does not bear any * linkages. For non-root tasks, links must be established using * method linkSubtasks before use. * - *
Sample Usage. A version of Fibonacci: + *
Sample Usage. A version of Fibonacci: *
* class Fib extends BinaryAsyncAction { * final int n; @@ -101,10 +101,9 @@ public abstract class BinaryAsyncAction * Overridable callback action triggered upon complete of * subtasks. Upon invocation, both subtasks have completed. * After return, this task isDone and is joinable by - * other tasks. The default version of this method does - * nothing. But it may may be overridden in subclasses to perform - * some action (for example a reduction) when this task is - * completes. + * other tasks. The default version of this method does nothing. + * But it may be overridden in subclasses to perform some action + * (for example a reduction) when this task is completes. * @param x one subtask * @param y the other subtask */ @@ -174,7 +173,7 @@ public abstract class BinaryAsyncAction break; try { p.onComplete(a, s); - } catch(Throwable rex) { + } catch (Throwable rex) { p.completeExceptionally(rex); return; } @@ -251,7 +250,7 @@ public abstract class BinaryAsyncAction * @param update the new value * @return true if successful */ - protected final boolean compareAndSetControlState(int expect, + protected final boolean compareAndSetControlState(int expect, int update) { return controlStateUpdater.compareAndSet(this, expect, update); }