summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/GLContext.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-01-08 06:43:09 +0100
committerSven Gothel <[email protected]>2012-01-08 06:43:09 +0100
commit6451e3c0c79fca92a39e32c2600c69f16dfc7f4d (patch)
tree84ec8e5be0a7a82f40abcb0adfdabaf6cf8d320c /src/jogl/classes/javax/media/opengl/GLContext.java
parent098398c2a9145447da5314eed9792b3738c2d515 (diff)
GLContext/NativeSurface Impl's toString(): Add lock.toString()
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLContext.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 2d304b77c..8626400f7 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -49,6 +49,8 @@ import java.util.HashSet;
import javax.media.nativewindow.AbstractGraphicsDevice;
import com.jogamp.common.util.IntObjectHashMap;
+import com.jogamp.common.util.locks.LockFactory;
+import com.jogamp.common.util.locks.RecursiveLock;
import jogamp.opengl.Debug;
import jogamp.opengl.GLContextImpl;
@@ -107,12 +109,15 @@ public abstract class GLContext {
protected static final int CTX_IMPL_ACCEL_SOFT = 1 << 0;
/** GLContext {@link com.jogamp.gluegen.runtime.ProcAddressTable} caching related: GL hardware implementation */
protected static final int CTX_IMPL_ACCEL_HARD = 1 << 1;
-
+
private static ThreadLocal<GLContext> currentContext = new ThreadLocal<GLContext>();
private HashMap<String, Object> attachedObjectsByString = new HashMap<String, Object>();
private IntObjectHashMap attachedObjectsByInt = new IntObjectHashMap();
+ // RecursiveLock maintains a queue of waiting Threads, ensuring the longest waiting thread will be notified at unlock.
+ protected RecursiveLock lock = LockFactory.createRecursiveLock();
+
/** The underlying native OpenGL context */
protected long contextHandle;
@@ -411,6 +416,8 @@ public abstract class GLContext {
sb.append(",\n\tDrawable: ");
sb.append(getGLDrawable());
}
+ sb.append(", lock ");
+ sb.append(lock.toString());
return sb;
}