Top Description Fields Constructors Methods
jogamp.opengl

public Class ThreadingImpl

extends Object
Class Inheritance
Imports
java.lang.reflect.InvocationTargetException, java.security.AccessController, .PrivilegedAction, com.jogamp.nativewindow.NativeWindowFactory, com.jogamp.opengl.GLException, .GLProfile, .Threading.Mode, com.jogamp.common.JogampRuntimeException, com.jogamp.common.util.PropertyAccess, .ReflectionUtil

Implementation of the com.jogamp.opengl.Threading class.

Field Summary

Modifier and TypeField and Description
private static boolean
protected static final boolean
private static boolean
private static Threading.Mode
private static boolean
private static final ToolkitThreadingPlugin

Constructor Summary

AccessConstructor and Description
private
ThreadingImpl()

No reason to ever instantiate this class

Method Summary

Modifier and TypeMethod and Description
public static final void
disableSingleThreading()

If an implementation of the com.jogamp.opengl APIs offers a multithreading option but the default behavior is single-threading, this API provides a mechanism for end users to disable single-threading in this implementation.

public static Threading.Mode
public static final void
invokeOnOpenGLThread(final boolean wait, final Runnable r)

Executes the passed Runnable on the single thread used for all OpenGL work in this com.jogamp.opengl API implementation.

public static final void
invokeOnWorkerThread(final boolean wait, final Runnable r)

public static final boolean
isOpenGLThread()

Indicates whether the current thread is capable of performing OpenGL-related work.

public static final boolean
isSingleThreaded()

Indicates whether OpenGL work is being automatically forced to a single thread in this implementation.

public static final boolean
public static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_isX11back to summary
private static boolean _isX11
DEBUGback to summary
protected static final boolean DEBUG
hasAWTback to summary
private static boolean hasAWT
modeback to summary
private static Threading.Mode mode
singleThreadedback to summary
private static boolean singleThreaded
threadingPluginback to summary
private static final ToolkitThreadingPlugin threadingPlugin

Constructor Detail

ThreadingImplback to summary
private ThreadingImpl()

No reason to ever instantiate this class

Method Detail

disableSingleThreadingback to summary
public static final void disableSingleThreading()

If an implementation of the com.jogamp.opengl APIs offers a multithreading option but the default behavior is single-threading, this API provides a mechanism for end users to disable single-threading in this implementation. Users are strongly discouraged from calling this method unless they are aware of all of the consequences and are prepared to enforce some amount of threading restrictions in their applications. Disabling single-threading, for example, may have unintended consequences on GLAutoDrawable implementations such as GLCanvas, GLJPanel and GLPbuffer. Currently there is no supported way to re-enable it once disabled, partly to discourage careless use of this method. This method should be called as early as possible in an application.

getModeback to summary
public static Threading.Mode getMode()
invokeOnOpenGLThreadback to summary
public static final void invokeOnOpenGLThread(final boolean wait, final Runnable r) throws GLException

Executes the passed Runnable on the single thread used for all OpenGL work in this com.jogamp.opengl API implementation. It is not specified exactly which thread is used for this purpose. This method should only be called if the single-thread model is in use and if the current thread is not the OpenGL thread (i.e., if isOpenGLThread() returns false). It is up to the end user to check to see whether the current thread is the OpenGL thread and either execute the Runnable directly or perform the work inside it.

invokeOnWorkerThreadback to summary
public static final void invokeOnWorkerThread(final boolean wait, final Runnable r) throws GLException
isOpenGLThreadback to summary
public static final boolean isOpenGLThread() throws GLException

Indicates whether the current thread is capable of performing OpenGL-related work.

Method always returns true if getMode() == Mode#MT or isSingleThreaded() == false.

isSingleThreadedback to summary
public static final boolean isSingleThreaded()

Indicates whether OpenGL work is being automatically forced to a single thread in this implementation.

isToolkitThreadback to summary
public static final boolean isToolkitThread() throws GLException
isX11back to summary
public static boolean isX11()