1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
import java.util.*; |
56 |
|
* } |
57 |
|
* } |
58 |
|
* </pre> |
59 |
– |
* |
59 |
|
*/ |
60 |
|
public abstract class LinkedAsyncAction extends ForkJoinTask<Void> { |
61 |
|
|
140 |
|
* Overridable callback action triggered by <tt>complete</tt>. Upon |
141 |
|
* invocation, all subtasks have completed. After return, this |
142 |
|
* task <tt>isDone</tt> and is joinable by other tasks. The |
143 |
< |
* default version of this method does nothing. But it may may be |
143 |
> |
* default version of this method does nothing. But it may be |
144 |
|
* overridden in subclasses to perform some action when this task |
145 |
|
* is about to complete. |
146 |
|
*/ |
311 |
|
* @param update the new value |
312 |
|
* @return true if successful |
313 |
|
*/ |
314 |
< |
protected final boolean compareAndSetControlState(int expect, |
314 |
> |
protected final boolean compareAndSetControlState(int expect, |
315 |
|
int update) { |
316 |
|
return controlStateUpdater.compareAndSet(this, expect, update); |
317 |
|
} |
318 |
|
|
319 |
|
/** |
320 |
< |
* Sets the control state to the given value, |
320 |
> |
* Sets the control state to the given value. |
321 |
|
* @param value the new value |
322 |
|
*/ |
323 |
|
protected final void setControlState(int value) { |
325 |
|
} |
326 |
|
|
327 |
|
/** |
328 |
< |
* Increment the control state |
328 |
> |
* Increments the control state. |
329 |
|
* @return true if successful |
330 |
|
*/ |
331 |
|
protected final void incrementControlState() { |
333 |
|
} |
334 |
|
|
335 |
|
/** |
336 |
< |
* Decrement the control state |
336 |
> |
* Decrements the control state. |
337 |
|
* @return true if successful |
338 |
|
*/ |
339 |
|
protected final void decrementControlState() { |