-
CSR
-
Resolution: Withdrawn
-
P3
-
None
-
None
-
source
-
minimal
-
Negligible risk of a name-clash with user ForkJoinTask subclasses
-
Java API
-
JDK
Summary
Add cancel-on-interrupt ForkJoinTask adaptor
Problem
Some potential FJ usages require that tasks are cancelled when their threads are interrupted, which is not the default policy for adapting Callables.
Solution
Introduce a method adaptInterruptible that supports this policy. An overview of the solution. Alternative solutions may be discussed;
Specification
/**
* Returns a new {@code ForkJoinTask} that performs the {@code call}
* method of the given {@code Callable} as its action, and returns
* its result upon {@link #join}, translating any checked exceptions
* encountered into {@code RuntimeException}. Additionally,
* invocations of {@code cancel} with {@code mayInterruptIfRunning
* true} will attempt to interrupt the thread performing the task.
*
* @param callable the callable action
* @param <T> the type of the callable's result
* @return the task
*
* @since 15
*/
public static <T> ForkJoinTask<T> adaptInterruptible(Callable<? extends T> callable)
- csr of
-
JDK-8246585 ForkJoin updates
-
- Resolved
-