--- jsr166/src/test/loops/BinaryAsyncAction.java 2015/09/12 18:11:24 1.17 +++ jsr166/src/test/loops/BinaryAsyncAction.java 2015/09/12 19:16:16 1.18 @@ -57,7 +57,11 @@ import java.util.concurrent.atomic.*; * */ public abstract class BinaryAsyncAction extends ForkJoinTask { - + 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 @@ -165,7 +169,7 @@ public abstract class BinaryAsyncAction a.sibling = null; a.parent = null; a.completeThis(); - if (p == null || p.markForkJoinTask()) + if (p == null || p.compareAndSetControlState(0, 1)) break; try { p.onComplete(a, s); @@ -229,8 +233,6 @@ public abstract class BinaryAsyncAction super.reinitialize(); } -<<<<<<< BinaryAsyncAction.java -======= /** * Gets the control state, which is initially zero, or negative if * this task has completed or cancelled. Once negative, the value @@ -279,6 +281,6 @@ public abstract class BinaryAsyncAction protected final void decrementControlState() { controlStateUpdater.decrementAndGet(this); } ->>>>>>> 1.14 + }