summaryrefslogtreecommitdiffstats
path: root/src/jogl
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2013-01-11 08:14:49 +0100
committerSven Gothel <sgothel@jausoft.com>2013-01-11 08:14:49 +0100
commitbdc2e57ffc91d88e187ded8c42335710448f50f0 (patch)
tree9c3cc6ac695fee30b8e0d074597781e3520f0381 /src/jogl
parent224fab1b2c71464826594740022fdcbe278867dc (diff)
Minor: GLWindow fix size validation; GLContextImpl: Remove hold ctx lock count constraints at destroy.
Diffstat (limited to 'src/jogl')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 8a261c21c..36aaeb597 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -325,16 +325,13 @@ public abstract class GLContextImpl extends GLContext {
try {
// Must hold the lock around the destroy operation to make sure we
// don't destroy the context while another thread renders to it.
- lock.lock(); // holdCount++ -> 1 - 3 (1: not locked, 2-3: destroy while rendering)
+ lock.lock(); // holdCount++ -> 1 - n (1: not locked, 2-n: destroy while rendering)
if ( lock.getHoldCount() > 2 ) {
final String msg = getThreadName() + ": GLContextImpl.destroy: obj " + toHexString(hashCode()) + ", ctx " + toHexString(contextHandle);
if (DEBUG || TRACE_SWITCH) {
System.err.println(msg+" - Lock was hold more than once - makeCurrent/release imbalance: "+lock);
Thread.dumpStack();
}
- if ( lock.getHoldCount() > 3 ) {
- throw new GLException(msg+" - Lock was hold more than twice - makeCurrent/release imbalance: "+lock);
- }
}
try {
// release current context
@@ -471,7 +468,7 @@ public abstract class GLContextImpl extends GLContext {
// and one thread can only have one context current!
final GLContext current = getCurrent();
if (current != null) {
- if (current == this) {
+ if (current == this) { // implicit recursive locking!
// Assume we don't need to make this context current again
// For Mac OS X, however, we need to update the context to track resizes
drawableUpdatedNotify();
@@ -1724,7 +1721,7 @@ public abstract class GLContextImpl extends GLContext {
public boolean hasWaiters() {
return lock.getQueueLength()>0;
}
-
+
//---------------------------------------------------------------------------
// Special FBO hook
//