diff options
author | Sven Gothel <[email protected]> | 2012-03-25 03:29:53 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-03-25 03:29:53 +0200 |
commit | 3ed491213f8f7f05d7b9866b50d764370d8ff5f6 (patch) | |
tree | 07ea2547be486eb50db9d79a19f6e0c4dfa4dc70 /src/nativewindow | |
parent | 45a42f7c7f7fce4e6c7eb495591c438bdf0170a2 (diff) |
Enhance and generalize AWT Threading* implementation; Minor changes ..
Threading*:
- add invoke(..) generalizing the Therading decision
GLCanvas:
- remove 'manual' Threading decision, simply call Threading.invoke(..)
- use anonymous Runnable instances
- remove drawable lock, drawable is volatile instead
GLJPanel:
- remove 'manual' Threading decision, simply call Threading.invoke(..)
- use anonymous Runnable instances
- DEBUG: Use getThreadName() prefix
GLContextImpl:
- Remove GLWorkerThread idle command on makeCurrent(),
no holding of context in worker thread while idle.
- DEBUG: Use getThreadName() prefix
X11GLXContext:
- DEBUG: Use getThreadName() prefix
TODO: Validate whether it's OK for GLCanvas and GLJPanel to set Threading.Mode.MT as the default mode!
Diffstat (limited to 'src/nativewindow')
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java index 697be9f93..b6bf63d44 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java +++ b/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java @@ -89,13 +89,14 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac final GraphicsDevice device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice(); - long displayHandle = X11SunJDKReflection.graphicsDeviceGetDisplay(device); + final long displayHandleAWT = X11SunJDKReflection.graphicsDeviceGetDisplay(device); + final long displayHandle; boolean owner = false; - if(0==displayHandle) { + if(0==displayHandleAWT) { displayHandle = X11Util.openDisplay(null); owner = true; if(DEBUG) { - System.err.println(Thread.currentThread().getName() + " - X11AWTGraphicsConfigurationFactory: create local X11 display"); + System.err.println(getThreadName()+" - X11AWTGraphicsConfigurationFactory: Null AWT dpy, create local X11 display: "+toHexString(displayHandle)); } } else { /** @@ -104,12 +105,12 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac * some work, but some behave erratic. * I.e. hangs in XQueryExtension(..) via X11GraphicsScreen. */ - final String displayName = X11Lib.XDisplayString(displayHandle); - if(DEBUG) { - System.err.println(Thread.currentThread().getName() + " - X11AWTGraphicsConfigurationFactory: create X11 display @ "+displayName+" / 0x"+Long.toHexString(displayHandle)); - } + final String displayName = X11Lib.XDisplayString(displayHandleAWT); displayHandle = X11Util.openDisplay(displayName); owner = true; + if(DEBUG) { + System.err.println(getThreadName()+" - X11AWTGraphicsConfigurationFactory: AWT dpy "+displayName+" / "+toHexString(displayHandleAWT)+", create X11 display "+toHexString(displayHandle)); + } } final ToolkitLock lock = owner ? NativeWindowFactory.getDefaultToolkitLock(NativeWindowFactory.TYPE_AWT) : // own non-shared X11 display connection, no X11 lock |