diff options
author | Sven Gothel <[email protected]> | 2012-09-30 20:29:06 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-09-30 20:29:06 +0200 |
commit | 7302b1014a33c373650ed20e6dd363bb6c2a984e (patch) | |
tree | e20a226bacb18571102b7e581db6846ca1fc933f /src | |
parent | e5c1e607d582d002256a07916aba71841744fb4d (diff) |
NullToolkitLock.validateLocker(): Throw exception if locking is required (detecting impl. bugs)
Diffstat (limited to 'src')
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java | 8 |
1 files changed, 3 insertions, 5 deletions
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."); } } |