|
GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java (public API).
|
Helper class to provide a Runnable queue implementation with a Runnable wrapper which notifies after execution for the invokeAndWait() semantics.
More...
Public Member Functions | |
| FunctionTask (final Function< R, A > runnable, final Object syncObject, final boolean catchExceptions, final PrintStream exceptionOut) | |
| Create a RunnableTask object w/ synchronization, ie. More... | |
| final Function< R, A > | getRunnable () |
| Return the user action. More... | |
| final void | setArgs (final A... args) |
Sets the arguments for run(). More... | |
| final R | getResult () |
Retrieves the cached result of run() and is cleared within this method. More... | |
| final void | run () |
| final R | eval (final A... args) |
Implementation may compute variable args list and returns a result. More... | |
Public Member Functions inherited from com.jogamp.common.util.TaskBase | |
| final Thread | getExecutionThread () |
Returns the execution thread or null if not yet run(). More... | |
| final Object | getSyncObject () |
| Return the synchronization object if any. More... | |
| final void | setAttachment (final Object o) |
| Attach a custom object to this task. More... | |
| final Object | getAttachment () |
| Return the attachment object if any. More... | |
| abstract void | run () |
| final void | flush (final Throwable t) |
| Simply flush this task and notify a waiting executor. More... | |
| final boolean | isInQueue () |
| final boolean | isExecuted () |
| final boolean | isFlushed () |
| final boolean | hasWaiter () |
| final Throwable | getThrowable () |
| final long | getTimestampCreate () |
| final long | getTimestampBeforeExec () |
| final long | getTimestampAfterExec () |
| final long | getDurationInQueue () |
| final long | getDurationInExec () |
| final long | getDurationTotal () |
| String | toString () |
| R | eval (A... args) |
Implementation may compute variable args list and returns a result. More... | |
Static Public Member Functions | |
| static< U, V > FunctionTask< U, V > | invokeOnCurrentThread (final Function< U, V > func, final V... args) |
Invokes func on the current Thread. More... | |
| 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, Runnable, String) for details. More... | |
Protected Attributes | |
| Function< R, A > | runnable |
| R | result |
| A[] | args |
Protected Attributes inherited from com.jogamp.common.util.TaskBase | |
| final Object | syncObject |
| final boolean | catchExceptions |
| final PrintStream | exceptionOut |
| final Throwable | sourceStack |
| Object | attachment |
| Throwable | runnableException |
| long | tCreated |
| long | tStarted |
| volatile long | tExecuted |
| volatile boolean | isExecuted |
| volatile boolean | isFlushed |
| volatile Thread | execThread |
Additional Inherited Members | |
Protected Member Functions inherited from com.jogamp.common.util.TaskBase | |
| TaskBase (final Object syncObject, final boolean catchExceptions, final PrintStream exceptionOut) | |
| final String | getExceptionOutIntro () |
| final void | printSourceTrace () |
Helper class to provide a Runnable queue implementation with a Runnable wrapper which notifies after execution for the invokeAndWait() semantics.
Definition at line 39 of file FunctionTask.java.
| com.jogamp.common.util.FunctionTask< R, A >.FunctionTask | ( | final Function< R, A > | runnable, |
| final Object | syncObject, | ||
| final boolean | catchExceptions, | ||
| final PrintStream | exceptionOut | ||
| ) |
Create a RunnableTask object w/ synchronization, ie.
suitable for invokeAndWait().
| runnable | the user action |
| syncObject | the synchronization object the caller shall wait until runnable execution is completed, or null if waiting is not desired. |
| catchExceptions | Influence an occurring exception during runnable execution. If true, the exception is silenced and can be retrieved via getThrowable(), otherwise the exception is thrown. |
| exceptionOut | If not null, exceptions are written to this PrintStream. |
Definition at line 120 of file FunctionTask.java.
| final R com.jogamp.common.util.FunctionTask< R, A >.eval | ( | final A... | args | ) |
Implementation may compute variable args list and returns a result.
| args | variable argument list, A[], maybe null |
Implements com.jogamp.common.util.Function< R, A >.
Definition at line 210 of file FunctionTask.java.
| final R com.jogamp.common.util.FunctionTask< R, A >.getResult | ( | ) |
Retrieves the cached result of run() and is cleared within this method.
Definition at line 144 of file FunctionTask.java.
| final Function< R, A > com.jogamp.common.util.FunctionTask< R, A >.getRunnable | ( | ) |
Return the user action.
Definition at line 128 of file FunctionTask.java.
|
static |
Invokes func on the current Thread.
The result can be retrieved via FunctionTask#getResult(), using the returned instance.
FunctionTask Definition at line 55 of file FunctionTask.java.
|
static |
Invokes func on a new InterruptSource.Thread, see InterruptSource.Thread#Thread(ThreadGroup, Runnable, String) for details.
The result can be retrieved via FunctionTask#getResult(), using the returned instance.
| tg | the ThreadGroup for the new thread, maybe null |
| threadName | the name for the new thread, maybe null |
| waitUntilDone | if true, waits until func execution is completed, otherwise returns immediately. |
| func | the Function to execute. |
| args | the Function arguments |
FunctionTask Definition at line 77 of file FunctionTask.java.
| final void com.jogamp.common.util.FunctionTask< R, A >.run | ( | ) |
Calls eval(Object...).
You may set the eval(Object...) arguments via setArgs(Object...) and retrieve the result via getResult().
Reimplemented from com.jogamp.common.util.TaskBase.
Definition at line 161 of file FunctionTask.java.
| final void com.jogamp.common.util.FunctionTask< R, A >.setArgs | ( | final A... | args | ) |
Sets the arguments for run().
They will be cleared after calling run() or eval(Object...).
Definition at line 136 of file FunctionTask.java.
|
protected |
Definition at line 42 of file FunctionTask.java.
|
protected |
Definition at line 41 of file FunctionTask.java.
|
protected |
Definition at line 40 of file FunctionTask.java.