From 9c96be7c0a1a19365ae983908260c6ff44f045c4 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Tue, 2 Oct 2012 17:13:56 +0200
Subject: NativeWindowFactory: Remove 'remedy' of Bug 613 Commit
 92398025abdabb2fdef0d78edd41e730991a6f94 GlobalToolkitLock for create/destroy

Turns out on it has no effect and ATI prop. driver still has XCB failures at this point.
---
 .../classes/jogamp/opengl/x11/glx/X11GLXContext.java | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/x11')

diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
index f7389d42e..89907ba15 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
@@ -48,8 +48,6 @@ import java.util.Map;
 import javax.media.nativewindow.AbstractGraphicsConfiguration;
 import javax.media.nativewindow.AbstractGraphicsDevice;
 import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.nativewindow.ToolkitLock;
 import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLContext;
 import javax.media.opengl.GLException;
@@ -182,16 +180,10 @@ public abstract class X11GLXContext extends GLContextImpl {
 
   @Override
   protected void destroyContextARBImpl(long ctx) {
-    final ToolkitLock tkLock = NativeWindowFactory.getGlobalToolkitLockIfRequired();
-    tkLock.lock();
-    try {
-        long display = drawable.getNativeSurface().getDisplayHandle();
-    
-        glXMakeContextCurrent(display, 0, 0, 0);
-        GLX.glXDestroyContext(display, ctx);
-    } finally {
-        tkLock.unlock();
-    }
+    final long display = drawable.getNativeSurface().getDisplayHandle();
+
+    glXMakeContextCurrent(display, 0, 0, 0);
+    GLX.glXDestroyContext(display, ctx);
   }
   private static final int ctx_arb_attribs_idx_major = 0;
   private static final int ctx_arb_attribs_idx_minor = 2;
@@ -250,8 +242,6 @@ public abstract class X11GLXContext extends GLContextImpl {
     AbstractGraphicsDevice device = config.getScreen().getDevice();
     final long display = device.getHandle();
 
-    final ToolkitLock tkLock = NativeWindowFactory.getGlobalToolkitLockIfRequired();
-    tkLock.lock();
     try {
         // critical path, a remote display might not support this command,
         // hence we need to catch the X11 Error within this block.
@@ -262,8 +252,6 @@ public abstract class X11GLXContext extends GLContextImpl {
           Throwable t = new Throwable(getThreadName()+": Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
           t.printStackTrace();
         }
-    } finally {
-        tkLock.unlock();
     }
     
     if(0!=ctx) {
-- 
cgit v1.2.3