diff options
Diffstat (limited to 'src/nativewindow/classes/com/jogamp')
3 files changed, 12 insertions, 21 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/NullWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NullWindow.java index 4458d7b3d..a1c2b594c 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/NullWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NullWindow.java @@ -117,10 +117,6 @@ public class NullWindow implements NativeWindow, SurfaceChangeable { return config; } - public Object getWrappedWindow() { - return null; - } - public final boolean isTerminalObject() { return true; } diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java index 06ce54368..52c211615 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/RecursiveToolkitLock.java @@ -6,8 +6,8 @@ import javax.media.nativewindow.*; // Reentrance locking toolkit // public class RecursiveToolkitLock implements ToolkitLock { - private Thread owner; - private int recursionCount; + private Thread owner = null; + private int recursionCount = 0; private Exception lockedStack = null; private static final long timeout = 3000; // maximum wait 3s @@ -31,6 +31,10 @@ public class RecursiveToolkitLock implements ToolkitLock { return null != owner; } + public synchronized int getRecursionCount() { + return recursionCount; + } + /** Recursive and blocking lockSurface() implementation */ public synchronized void lock() { Thread cur = Thread.currentThread(); @@ -49,10 +53,10 @@ public class RecursiveToolkitLock implements ToolkitLock { } if(owner != null) { lockedStack.printStackTrace(); - throw new RuntimeException("Waited "+timeout+"ms for: "+owner+" - "+cur); + throw new RuntimeException("Waited "+timeout+"ms for: "+owner+" - "+cur+", with recursionCount "+recursionCount+", lock: "+this); } owner = cur; - lockedStack = new Exception("Previously locked by "+owner); + lockedStack = new Exception("Previously locked by "+owner+", lock: "+this); } @@ -62,7 +66,7 @@ public class RecursiveToolkitLock implements ToolkitLock { } /** Recursive and unblocking unlockSurface() implementation */ - public synchronized void unlock(Runnable releaseAfterUnlockBeforeNotify) { + public synchronized void unlock(Runnable taskAfterUnlockBeforeNotify) { Thread cur = Thread.currentThread(); if (owner != cur) { lockedStack.printStackTrace(); @@ -74,8 +78,8 @@ public class RecursiveToolkitLock implements ToolkitLock { } owner = null; lockedStack = null; - if(null!=releaseAfterUnlockBeforeNotify) { - releaseAfterUnlockBeforeNotify.run(); + if(null!=taskAfterUnlockBeforeNotify) { + taskAfterUnlockBeforeNotify.run(); } notifyAll(); } diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java index 08b2ceec9..6e3c62d3b 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java @@ -59,16 +59,7 @@ public class X11Util { static { NWJNILibLoader.loadNativeWindow("x11"); - // No concurrent threading support in case AWT could be used, - // Mixing AWT and X11/NEWT results in a segmentation fault: - // C pthread_mutex_lock+0x4 - // J sun.awt.X11.XlibWrapper.XGetDefault - // J sun.awt.X11.XToolkit.initializeMultiClickTime - // J sun.awt.X11.XToolkit.getMultiClickTime - // - // It seems like (Oracle's) AWT's Display locking is buggy. - // - initialize( ! NativeWindowFactory.isAWTAvailable() ) ; + initialize( true ); long dpy = X11Lib.XOpenDisplay(null); XLockDisplay(dpy); |