summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/javax/media
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-06-17 14:15:30 +0000
committerSven Gothel <[email protected]>2009-06-17 14:15:30 +0000
commit1e42ccc8a1c063056e7b0b41990e66d1718221b7 (patch)
tree8e23be5c70181ca460e7a408a834fdd55dd5fe8c /src/nativewindow/classes/javax/media
parenta92906bcb4ce4746f291d40a736949ec8476de61 (diff)
- Fix: Native X11 Display deadlock (Linux x86_64 32bit on 64bit)
It turns out that under some circumstances, e.g. >3 threads within initialization time, the static X11Display usage result in a native deadlock within glXQueryServerString(). The call never returned. May be This happend even with NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); Removed X11Util.getStaticDefaultDisplay() This allows us to remove the ToolkitLock around these segments, due to a thread local X11Display utilization. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1977 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/nativewindow/classes/javax/media')
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java5
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java9
2 files changed, 5 insertions, 9 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java b/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
index 27e59d8c8..6f83896fa 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
@@ -47,8 +47,9 @@ package javax.media.nativewindow;
<PRE>
NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
try {
- long displayHandle = X11Util.getStaticDefaultDisplay();
- ...
+ long displayHandle = X11Util.getThreadLocalDefaultDisplay();
+ ... some code dealing with shared resources
+ ... ie the window surface
} finally {
NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java
index f434050f2..03121dfaa 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java
@@ -74,13 +74,8 @@ public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneabl
}
private static int fetchScreen(int screen) {
- NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
- try {
- if(!com.sun.nativewindow.impl.x11.X11Util.isXineramaEnabledOnStaticDefaultDisplay()) {
- return screen;
- }
- } finally {
- NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ if(!com.sun.nativewindow.impl.x11.X11Util.isXineramaEnabledOnThreadLocalDefaultDisplay()) {
+ return screen;
}
return 0;
}