ForkJoinPool.invoke

Performs the given task, returning its result upon completion. If the computation encounters an unchecked Exception or Error, it is rethrown as the outcome of this invocation. Rethrown exceptions behave in the same way as regular exceptions, but, when possible, contain stack traces (as displayed for example using {@code ex.printStackTrace()}) of both the current thread as well as the thread actually encountering the exception; minimally only the latter.

@param task the task @param (T) the type of the task's result @return the task's result @throws NullPointerException if the task is null @throws RejectedExecutionException if the task cannot be scheduled for execution

class ForkJoinPool
T
invoke
(
T
)

Meta