27package org.jau.util.parallel;
29import java.io.PrintStream;
31import org.jau.lang.InterruptSource;
32import org.jau.lang.InterruptedRuntimeException;
33import org.jau.util.Function;
82 if( !waitUntilDone ) {
88 final Object sync =
new Object();
97 }
catch (
final InterruptedException ie) {
101 if(
null!=throwable) {
102 throw new RuntimeException(throwable);
171 tStarted = System.currentTimeMillis();
175 }
catch (
final Throwable t) {
193 }
catch (
final Throwable t) {
java.lang.Thread specialization implementing InterruptSource to track java.lang.Thread#interrupt() ca...
static Thread create(final ThreadGroup tg, final Runnable target, final String name)
Depending on whether name is null, either Thread(ThreadGroup, Runnable, String) or Thread(ThreadGroup...
Unchecked exception propagating an InterruptedException where handling of the latter is not desired.
Helper class to provide a Runnable queue implementation with a Runnable wrapper which notifies after ...
static< U, V > FunctionTask< U, V > invokeOnNewThread(final ThreadGroup tg, final String threadName, final boolean waitUntilDone, final Function< U, V > func, final V... args)
Invokes func on a new InterruptSource.Thread, see InterruptSource.Thread#Thread(ThreadGroup,...
Function< R, A > runnable
FunctionTask(final Function< R, A > runnable, final Object syncObject, final boolean catchExceptions, final PrintStream exceptionOut)
Create a RunnableTask object w/ synchronization, ie.
final void setArgs(final A... args)
Sets the arguments for run().
static< U, V > FunctionTask< U, V > invokeOnCurrentThread(final Function< U, V > func, final V... args)
Invokes func on the current Thread.
final R eval(final A... args)
Implementation may compute variable args list and returns a result.
final Function< R, A > getRunnable()
Return the user action.
final R getResult()
Retrieves the cached result of run() and is cleared within this method.
Helper class to provide a Runnable queue implementation with a Runnable wrapper which notifies after ...
final Throwable getThrowable()
final String getExceptionOutIntro()
volatile Thread execThread
final boolean catchExceptions
volatile boolean isExecuted
final void printSourceTrace()
Throwable runnableException
final boolean isInQueue()
final PrintStream exceptionOut
Interface exposing java.lang.Thread#interrupt() source, intended for java.lang.Thread specializations...
Generic function interface to perform an action w/ given optional arguments producing an optional res...