57 |
|
* </pre> |
58 |
|
*/ |
59 |
|
public abstract class BinaryAsyncAction extends ForkJoinTask<Void> { |
60 |
< |
|
60 |
> |
private volatile int controlState; |
61 |
> |
|
62 |
> |
static final AtomicIntegerFieldUpdater<BinaryAsyncAction> controlStateUpdater = |
63 |
> |
AtomicIntegerFieldUpdater.newUpdater(BinaryAsyncAction.class, "controlState"); |
64 |
> |
|
65 |
|
/** |
66 |
|
* Parent to propagate completion; nulled after completion to |
67 |
|
* avoid retaining entire tree as garbage |
169 |
|
a.sibling = null; |
170 |
|
a.parent = null; |
171 |
|
a.completeThis(); |
172 |
< |
if (p == null || p.markForkJoinTask()) |
172 |
> |
if (p == null || p.compareAndSetControlState(0, 1)) |
173 |
|
break; |
174 |
|
try { |
175 |
|
p.onComplete(a, s); |
233 |
|
super.reinitialize(); |
234 |
|
} |
235 |
|
|
232 |
– |
<<<<<<< BinaryAsyncAction.java |
233 |
– |
======= |
236 |
|
/** |
237 |
|
* Gets the control state, which is initially zero, or negative if |
238 |
|
* this task has completed or cancelled. Once negative, the value |
281 |
|
protected final void decrementControlState() { |
282 |
|
controlStateUpdater.decrementAndGet(this); |
283 |
|
} |
284 |
< |
>>>>>>> 1.14 |
284 |
> |
|
285 |
|
|
286 |
|
} |