summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-09-30 20:29:06 +0200
committerSven Gothel <[email protected]>2012-09-30 20:29:06 +0200
commit7302b1014a33c373650ed20e6dd363bb6c2a984e (patch)
treee20a226bacb18571102b7e581db6846ca1fc933f
parente5c1e607d582d002256a07916aba71841744fb4d (diff)
NullToolkitLock.validateLocker(): Throw exception if locking is required (detecting impl. bugs)
-rwxr-xr-xmake/scripts/tests.sh2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java8
2 files changed, 4 insertions, 6 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 0908ef1fd..9e384d59f 100755
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -138,7 +138,7 @@ function jrun() {
#D_ARGS="-Djogl.debug.GLCanvas"
#D_ARGS="-Djogl.debug.GLContext -Dnativewindow.debug.X11Util.XSync"
#D_ARGS="-Dnativewindow.debug.X11Util.XSync -Dnativewindow.debug.ToolkitLock.TraceLock"
- D_ARGS="-Dnativewindow.debug.X11Util -Dnativewindow.debug.X11Util.XSync -Dnativewindow.debug.NullToolkitLock.InvalidLocked -Dnativewindow.debug.NativeWindow"
+ D_ARGS="-Dnativewindow.debug.NativeWindow"
#D_ARGS="-Dnativewindow.debug.ToolkitLock"
#D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.GLSLCode -Djogl.debug.TraceGL"
#D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.GLSLState"
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
index 211e15955..5fc5fe376 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
@@ -28,6 +28,7 @@
package jogamp.nativewindow;
+import javax.media.nativewindow.NativeWindowFactory;
import javax.media.nativewindow.ToolkitLock;
/**
@@ -35,8 +36,6 @@ import javax.media.nativewindow.ToolkitLock;
* without any locking. Since there is no locking it all, it is intrinsically recursive.
*/
public class NullToolkitLock implements ToolkitLock {
- public static final boolean INVALID_LOCKED = Debug.isPropertyDefined("nativewindow.debug.NullToolkitLock.InvalidLocked", true);
-
/** Singleton via {@link NativeWindowFactoryImpl#getNullToolkitLock()} */
protected NullToolkitLock() { }
@@ -55,9 +54,8 @@ public class NullToolkitLock implements ToolkitLock {
@Override
public final void validateLocked() throws RuntimeException {
- /* nop */
- if(INVALID_LOCKED) {
- throw new RuntimeException("NullToolkitLock does not lock");
+ if( NativeWindowFactory.requiresToolkitLock() ) {
+ throw new RuntimeException("NullToolkitLock does not lock, but locking is required.");
}
}