com.jogamp.opengl.impl
Class ThreadingImpl

java.lang.Object
  extended by com.jogamp.opengl.impl.ThreadingImpl

public class ThreadingImpl
extends Object

Implementation of the Threading class.


Field Summary
static int AWT
           
protected static boolean DEBUG
           
static int WORKER
           
 
Method Summary
static void disableSingleThreading()
          If an implementation of the javax.media.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.
static int getMode()
           
static void invokeOnOpenGLThread(Runnable r)
          Executes the passed Runnable on the single thread used for all OpenGL work in this javax.media.opengl API implementation.
static boolean isAWTMode()
          This is a workaround for AWT-related deadlocks which only seem to show up in the context of applets
static boolean isOpenGLThread()
          Indicates whether the current thread is the single thread on which this implementation of the javax.media.opengl APIs performs all of its OpenGL-related work.
static boolean isSingleThreaded()
          Indicates whether OpenGL work is being automatically forced to a single thread in this implementation.
static boolean isX11()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AWT

public static final int AWT
See Also:
Constant Field Values

WORKER

public static final int WORKER
See Also:
Constant Field Values

DEBUG

protected static final boolean DEBUG
Method Detail

isX11

public static boolean isX11()

getMode

public static int getMode()

disableSingleThreading

public static void disableSingleThreading()
If an implementation of the javax.media.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.


isSingleThreaded

public static boolean isSingleThreaded()
Indicates whether OpenGL work is being automatically forced to a single thread in this implementation.


isOpenGLThread

public static boolean isOpenGLThread()
                              throws GLException
Indicates whether the current thread is the single thread on which this implementation of the javax.media.opengl APIs performs all of its OpenGL-related work. This method should only be called if the single-thread model is in effect.

Throws:
GLException

invokeOnOpenGLThread

public static void invokeOnOpenGLThread(Runnable r)
                                 throws GLException
Executes the passed Runnable on the single thread used for all OpenGL work in this javax.media.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.

Throws:
GLException

isAWTMode

public static boolean isAWTMode()
This is a workaround for AWT-related deadlocks which only seem to show up in the context of applets



Copyright 2010 JogAmp Community.