134 |
|
* (DAG). Otherwise, executions may encounter a form of deadlock as |
135 |
|
* tasks cyclically wait for each other. However, this framework |
136 |
|
* supports other methods and techniques (for example the use of |
137 |
< |
* {@link Phaser}, {@link #helpQuiesce}, and {@link #complete}) that |
137 |
> |
* {@link java.util.concurrent.Phaser Phaser}, {@link #helpQuiesce}, and {@link #complete}) that |
138 |
|
* may be of use in constructing custom subclasses for problems that |
139 |
|
* are not statically structured as DAGs. To support such usages, a |
140 |
|
* ForkJoinTask may be atomically <em>tagged</em> with a {@code short} |
782 |
|
* unprocessed. |
783 |
|
* |
784 |
|
* @param tasks the collection of tasks |
785 |
+ |
* @param <T> the type of the values returned from the tasks |
786 |
|
* @return the tasks argument, to simplify usage |
787 |
|
* @throws NullPointerException if tasks or any element are null |
788 |
|
*/ |
1445 |
|
* |
1446 |
|
* @param runnable the runnable action |
1447 |
|
* @param result the result upon completion |
1448 |
+ |
* @param <T> the type of the result |
1449 |
|
* @return the task |
1450 |
|
*/ |
1451 |
|
public static <T> ForkJoinTask<T> adapt(Runnable runnable, T result) { |
1459 |
|
* encountered into {@code RuntimeException}. |
1460 |
|
* |
1461 |
|
* @param callable the callable action |
1462 |
+ |
* @param <T> the type of the callable's result |
1463 |
|
* @return the task |
1464 |
|
*/ |
1465 |
|
public static <T> ForkJoinTask<T> adapt(Callable<? extends T> callable) { |