GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.util.RunnableTask Class Reference

Helper class to provide a Runnable queue implementation with a Runnable wrapper which notifies after execution for the invokeAndWait() semantics. More...

Inheritance diagram for com.jogamp.common.util.RunnableTask:
Collaboration diagram for com.jogamp.common.util.RunnableTask:

Public Member Functions

 RunnableTask (final Runnable runnable, final Object syncObject, final boolean catchExceptions, final PrintStream exceptionOut)
 Create a RunnableTask object w/ synchronization, ie. More...
 
final Runnable getRunnable ()
 Return the user action. More...
 
final void run ()
 
- 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 ()
 

Static Public Member Functions

static RunnableTask invokeOnCurrentThread (final Runnable runnable)
 Invokes runnable on the current Thread. More...
 
static RunnableTask invokeOnNewThread (final ThreadGroup tg, final String threadName, final boolean waitUntilDone, final Runnable runnable)
 Invokes runnable on a new InterruptSource.Thread, see InterruptSource.Thread#Thread(ThreadGroup, Runnable, String) for details. More...
 

Protected Attributes

final Runnable runnable
 
- 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 ()
 

Detailed Description

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 RunnableTask.java.

Constructor & Destructor Documentation

◆ RunnableTask()

com.jogamp.common.util.RunnableTask.RunnableTask ( final Runnable  runnable,
final Object  syncObject,
final boolean  catchExceptions,
final PrintStream  exceptionOut 
)

Create a RunnableTask object w/ synchronization, ie.

suitable for invokeAndWait(), i.e. invoke(true, runnable).

Parameters
runnableThe user action
syncObjectThe synchronization object if caller wait until runnable execution is completed, or null if waiting is not desired.
catchExceptionsInfluence an occurring exception during runnable execution. If true, the exception is silenced and can be retrieved via getThrowable(), otherwise the exception is thrown.
exceptionOutIf not null, exceptions are written to this PrintStream.

Definition at line 107 of file RunnableTask.java.

Here is the caller graph for this function:

Member Function Documentation

◆ getRunnable()

final Runnable com.jogamp.common.util.RunnableTask.getRunnable ( )

Return the user action.

Definition at line 113 of file RunnableTask.java.

◆ invokeOnCurrentThread()

static RunnableTask com.jogamp.common.util.RunnableTask.invokeOnCurrentThread ( final Runnable  runnable)
static

Invokes runnable on the current Thread.

Parameters
runnablethe Runnable to execute on the current thread. The runnable must exit, i.e. not loop forever.
Returns
the newly created and invoked RunnableTask
Since
2.4.0

Definition at line 49 of file RunnableTask.java.

Here is the call graph for this function:

◆ invokeOnNewThread()

static RunnableTask com.jogamp.common.util.RunnableTask.invokeOnNewThread ( final ThreadGroup  tg,
final String  threadName,
final boolean  waitUntilDone,
final Runnable  runnable 
)
static

Invokes runnable on a new InterruptSource.Thread, see InterruptSource.Thread#Thread(ThreadGroup, Runnable, String) for details.

Parameters
tgthe ThreadGroup for the new thread, maybe null
threadNamethe name for the new thread, maybe null
waitUntilDoneif true, waits until runnable execution is completed, otherwise returns immediately.
runnablethe Runnable to execute on the new thread. If waitUntilDone is true, the runnable must exit, i.e. not loop forever.
Returns
the newly created and invoked RunnableTask
Since
2.3.2

Definition at line 66 of file RunnableTask.java.

Here is the call graph for this function:

◆ run()

final void com.jogamp.common.util.RunnableTask.run ( )

Reimplemented from com.jogamp.common.util.TaskBase.

Definition at line 118 of file RunnableTask.java.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ runnable

final Runnable com.jogamp.common.util.RunnableTask.runnable
protected

Definition at line 40 of file RunnableTask.java.


The documentation for this class was generated from the following file: