com.jogamp.opengl.impl
Class GLContextLock

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

public class GLContextLock
extends Object

Implements the makeCurrent / release locking behavior of the GLContext class. When "fail fast mode" is enabled, attempts to lock the same GLContextLock on more than one thread cause GLException to be raised. This lock is not recursive. Attempts to lock it more than once on a given thread will cause GLException to be raised.


Field Summary
protected static boolean DEBUG
           
 
Constructor Summary
GLContextLock()
           
 
Method Summary
 boolean getFailFastMode()
           
 Exception getLockedStack()
          holding the owners stack trace when lock is acquired and DEBUG is true
 boolean hasWaiters()
           
 boolean isHeld()
          Indicates whether this lock is held by the current thread.
 void lock()
          Locks this GLContextLock on the current thread.
 void setFailFastMode(boolean onOrOff)
           
 void unlock()
          Unlocks this GLContextLock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

protected static final boolean DEBUG
Constructor Detail

GLContextLock

public GLContextLock()
Method Detail

lock

public final void lock()
                throws GLException
Locks this GLContextLock on the current thread. If fail fast mode is enabled and the GLContextLock is already owned by another thread, throws GLException.

Throws:
GLException

unlock

public final void unlock()
                  throws GLException
Unlocks this GLContextLock.

Throws:
GLException

isHeld

public final boolean isHeld()
Indicates whether this lock is held by the current thread.


setFailFastMode

public final void setFailFastMode(boolean onOrOff)

getFailFastMode

public final boolean getFailFastMode()

hasWaiters

public final boolean hasWaiters()

getLockedStack

public final Exception getLockedStack()
holding the owners stack trace when lock is acquired and DEBUG is true



Copyright 2010 JogAmp Community.