diff options
Diffstat (limited to 'src/nativewindow')
4 files changed, 15 insertions, 31 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); diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java index 37606e8d8..09c605e1c 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java @@ -65,9 +65,8 @@ public interface NativeWindow extends SurfaceUpdatedListener { /** * Lock the surface of this native window<P> * - * The window handle, see {@link #getWindowHandle()}, - * and the surface handle, see {@link #lockSurface()}, <br> - * shall be set and be valid after a successfull call, + * The surface handle, see {@link #lockSurface()}, <br> + * shall be set and valid after a successfull call, * ie a return value other than {@link #LOCK_SURFACE_NOT_READY}.<P> * * The semantics of the underlying native locked resource @@ -88,8 +87,7 @@ public interface NativeWindow extends SurfaceUpdatedListener { /** * Unlock the surface of this native window * - * Shall not modify the window handle, see {@link #getWindowHandle()}, - * or the surface handle, see {@link #lockSurface()} <P> + * Shall not modify the surface handle, see {@link #lockSurface()} <P> * * @throws NativeWindowException if surface is not locked * @@ -140,11 +138,6 @@ public interface NativeWindow extends SurfaceUpdatedListener { /** * Returns the window handle for this NativeWindow. <P> * - * The window handle should be set/update by {@link #lockSurface()}, - * where {@link #unlockSurface()} is not allowed to modify it.<br> - * After {@link #unlockSurface()} it is no more guaranteed - * that the window handle is still valid.<p> - * * The window handle shall reflect the platform one * for all window related operations, e.g. open, close, resize. <P> * |