--- jsr166/src/test/loops/BinaryAsyncAction.java 2012/11/26 11:47:41 1.14
+++ jsr166/src/test/loops/BinaryAsyncAction.java 2015/09/12 19:16:16 1.18
@@ -13,7 +13,7 @@ import java.util.concurrent.atomic.*;
* have smaller stack space footprints and faster completion mechanics
* but higher per-task footprints. Compared to LinkedAsyncActions,
* BinaryAsyncActions are simpler to use and have less overhead in
- * typical uasges but are restricted to binary computation trees.
+ * typical usages but are restricted to binary computation trees.
*
*
Upon construction, a BinaryAsyncAction does not bear any
* linkages. For non-root tasks, links must be established using
@@ -57,11 +57,11 @@ import java.util.concurrent.atomic.*;
*
*/
public abstract class BinaryAsyncAction extends ForkJoinTask {
- private volatile int controlState;
-
- static final AtomicIntegerFieldUpdater controlStateUpdater =
+ private volatile int controlState;
+
+ static final AtomicIntegerFieldUpdater controlStateUpdater =
AtomicIntegerFieldUpdater.newUpdater(BinaryAsyncAction.class, "controlState");
-
+
/**
* Parent to propagate completion; nulled after completion to
* avoid retaining entire tree as garbage
@@ -120,7 +120,7 @@ public abstract class BinaryAsyncAction
* default version of this method does nothing and returns
* {@code true}.
* @return true if this task's exception should be propagated to
- * this task's parent.
+ * this task's parent
*/
protected boolean onException() {
return true;
@@ -169,7 +169,7 @@ public abstract class BinaryAsyncAction
a.sibling = null;
a.parent = null;
a.completeThis();
- if (p == null || p.compareAndSetControlState(0, 1))
+ if (p == null || p.compareAndSetControlState(0, 1))
break;
try {
p.onComplete(a, s);
@@ -282,4 +282,5 @@ public abstract class BinaryAsyncAction
controlStateUpdater.decrementAndGet(this);
}
+
}