diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11/glx')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index 96153dd27..235aea499 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -111,17 +111,14 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { // Init shared resources off thread // Will be released via ShutdownHook - sharedResourceImpl = new SharedResourceImplementation(); - sharedResourceRunner = new SharedResourceRunner(sharedResourceImpl); - sharedResourceThread = new Thread(sharedResourceRunner, Thread.currentThread().getName()+"-SharedResourceRunner"); - sharedResourceThread.setDaemon(true); // Allow JVM to exit, even if this one is running - sharedResourceThread.start(); + sharedResourceRunner = new SharedResourceRunner(new SharedResourceImplementation()); + sharedResourceRunner.start(); } } protected final void destroy(ShutdownType shutdownType) { if(null != sharedResourceRunner) { - sharedResourceRunner.releaseAndWait(); + sharedResourceRunner.stop(); sharedResourceRunner = null; } if(null != sharedMap) { @@ -147,9 +144,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { } private X11GraphicsDevice defaultDevice; - private SharedResourceImplementation sharedResourceImpl; private SharedResourceRunner sharedResourceRunner; - private Thread sharedResourceThread; private HashMap<String /* connection */, SharedResourceRunner.Resource> sharedMap; static class SharedResource implements SharedResourceRunner.Resource { @@ -322,7 +317,11 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { return false; } - public final boolean getWasSharedContextCreated(AbstractGraphicsDevice device) { + protected final Thread getSharedResourceThread() { + return sharedResourceRunner.start(); + } + + protected final boolean createSharedResource(AbstractGraphicsDevice device) { try { SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device); if(null!=sr) { |