38 |
|
* } |
39 |
|
* } |
40 |
|
* </pre> |
41 |
< |
* An alternative, and usually faster strategy is to instead use a |
41 |
> |
* An alternative, and usually faster, strategy is to instead use a |
42 |
|
* loop to fork subtasks: |
43 |
|
* <pre> |
44 |
|
* protected void compute() { |
89 |
|
* as parent, and each other as siblings. |
90 |
|
* @param x one subtask |
91 |
|
* @param y the other subtask |
92 |
< |
* @throws NullPointerException if either argument is null. |
92 |
> |
* @throws NullPointerException if either argument is null |
93 |
|
*/ |
94 |
|
public final void linkSubtasks(BinaryAsyncAction x, BinaryAsyncAction y) { |
95 |
|
x.parent = y.parent = this; |
192 |
|
* @param ex the exception to throw when joining this task |
193 |
|
* @throws NullPointerException if ex is null |
194 |
|
* @throws Throwable if any invocation of |
195 |
< |
* {@code onException} does so. |
195 |
> |
* {@code onException} does so |
196 |
|
*/ |
197 |
|
public final void completeExceptionally(Throwable ex) { |
198 |
|
BinaryAsyncAction a = this; |
209 |
|
/** |
210 |
|
* Returns this task's parent, or null if none or this task |
211 |
|
* is already complete. |
212 |
< |
* @return this task's parent, or null if none. |
212 |
> |
* @return this task's parent, or null if none |
213 |
|
*/ |
214 |
|
public final BinaryAsyncAction getParent() { |
215 |
|
return parent; |
218 |
|
/** |
219 |
|
* Returns this task's sibling, or null if none or this task is |
220 |
|
* already complete. |
221 |
< |
* @return this task's sibling, or null if none. |
221 |
> |
* @return this task's sibling, or null if none |
222 |
|
*/ |
223 |
|
public BinaryAsyncAction getSibling() { |
224 |
|
return sibling; |
267 |
|
} |
268 |
|
|
269 |
|
/** |
270 |
< |
* Sets the control state to the given value, |
270 |
> |
* Increments the control state. |
271 |
|
* @param value the new value |
272 |
|
*/ |
273 |
|
protected final void incrementControlState() { |
275 |
|
} |
276 |
|
|
277 |
|
/** |
278 |
< |
* Decrement the control state |
278 |
> |
* Decrements the control state. |
279 |
|
* @return true if successful |
280 |
|
*/ |
281 |
|
protected final void decrementControlState() { |