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.concurrent.*; |
15 |
|
* BinaryAsyncActions are simpler to use and have less overhead in |
16 |
|
* typical uasges but are restricted to binary computation trees. |
17 |
|
* |
18 |
< |
* <p> Upon construction, an BinaryAsyncAction does not bear any |
18 |
> |
* <p>Upon construction, an BinaryAsyncAction does not bear any |
19 |
|
* linkages. For non-root tasks, links must be established using |
20 |
|
* method <tt>linkSubtasks</tt> before use. |
21 |
|
* |
22 |
< |
* <p> <b>Sample Usage.</b> A version of Fibonacci: |
22 |
> |
* <p><b>Sample Usage.</b> A version of Fibonacci: |
23 |
|
* <pre> |
24 |
|
* class Fib extends BinaryAsyncAction { |
25 |
|
* final int n; |
101 |
|
* Overridable callback action triggered upon <tt>complete</tt> of |
102 |
|
* subtasks. Upon invocation, both subtasks have completed. |
103 |
|
* After return, this task <tt>isDone</tt> and is joinable by |
104 |
< |
* other tasks. The default version of this method does |
105 |
< |
* nothing. But it may be overridden in subclasses to perform |
106 |
< |
* some action (for example a reduction) when this task is |
107 |
< |
* completes. |
104 |
> |
* other tasks. The default version of this method does nothing. |
105 |
> |
* But it may be overridden in subclasses to perform some action |
106 |
> |
* (for example a reduction) when this task is completes. |
107 |
|
* @param x one subtask |
108 |
|
* @param y the other subtask |
109 |
|
*/ |