Top Description Inners Fields Constructors Methods
jogamp.opengl

public Class GLWorkerThread

extends Object
Class Inheritance
Imports
java.lang.reflect.InvocationTargetException, java.util.ArrayList, .List, com.jogamp.common.ExceptionUtils, com.jogamp.common.util.InterruptSource, .InterruptedRuntimeException, com.jogamp.opengl.GLContext

Singleton thread upon which all OpenGL work is performed by default. Unfortunately many vendors' OpenGL drivers are not really thread-safe and stability is much improved by performing OpenGL work on at most one thread. This is the default behavior of the GLAutoDrawable implementations according to the Threading class. The GLWorkerThread replaces the original AWT event queue thread-based mechanism for two reasons: first, more than one AWT event queue thread may be spawned, for example if a dialog is being shown; second, it avoids blocking the AWT event queue thread during OpenGL rendering.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static volatile Throwable
private static Object
private static List<Runnable>
private static volatile boolean
private static volatile boolean
private static volatile Thread
private static volatile Runnable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected static String
public static void
invoke(final boolean wait, final Runnable runnable)

public static void
invokeAndWait(final Runnable runnable)

public static void
invokeLater(final Runnable runnable)

public static boolean
isStarted()

Indicates whether the OpenGL worker thread was started, i.e., whether it is currently in use.

public static boolean
isWorkerThread()

Indicates whether the current thread is the OpenGL worker thread.

public static void
start()

Should only be called by Threading class if creation of the GLWorkerThread was requested via the opengl.1thread system property.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

exceptionback to summary
private static volatile Throwable exception
lockback to summary
private static Object lock
queueback to summary
private static List<Runnable> queue
shouldTerminateback to summary
private static volatile boolean shouldTerminate
startedback to summary
private static volatile boolean started
threadback to summary
private static volatile Thread thread
workback to summary
private static volatile Runnable work

Constructor Detail

GLWorkerThreadback to summary
public GLWorkerThread()

Method Detail

getThreadNameback to summary
protected static String getThreadName()
invokeback to summary
public static void invoke(final boolean wait, final Runnable runnable) throws InvocationTargetException, InterruptedException
invokeAndWaitback to summary
public static void invokeAndWait(final Runnable runnable) throws InvocationTargetException, InterruptedException
invokeLaterback to summary
public static void invokeLater(final Runnable runnable)
isStartedback to summary
public static boolean isStarted()

Indicates whether the OpenGL worker thread was started, i.e., whether it is currently in use.

isWorkerThreadback to summary
public static boolean isWorkerThread()

Indicates whether the current thread is the OpenGL worker thread.

startback to summary
public static void start()

Should only be called by Threading class if creation of the GLWorkerThread was requested via the opengl.1thread system property.
Start the GLWorkerThread iff not started yet!

jogamp.opengl back to summary

pack-priv Class GLWorkerThread.WorkerRunnable

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
pack-priv volatile boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

isRunningback to summary
pack-priv volatile boolean isRunning

Constructor Detail

WorkerRunnableback to summary
pack-priv WorkerRunnable()

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override