diff options
author | Sven Gothel <[email protected]> | 2010-10-09 21:29:05 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-10-09 21:29:05 +0200 |
commit | 231f9fe67c55ece5ee013cf1183f15200b602cd8 (patch) | |
tree | 795e7289f1595d4610decba1bd068661be7368f6 /src/jogl/classes/com/jogamp/opengl/impl/x11 | |
parent | 5e1a67c9bd3f8420eeab2d3879a795e25de22936 (diff) |
JOGL: WindowsWGLDrawableFactory/X11GLXDrawableFactory: synchronize sharedContext lock/release
Unsynchronized lead to an 'context already locked by another thread' exception
at initialization time (Windows: in general; X11: ATI and pbuffer drawable).
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/x11')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java index 2ae53fb9d..4b84227c3 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java @@ -223,17 +223,17 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { * The dummy context shall also use the same Display, * since switching Display in this regard is another ATI bug. */ - boolean usedSharedContext=false; if( isVendorATI() && null == GLContext.getCurrent() ) { - sharedContext.makeCurrent(); - usedSharedContext=true; - } - try { - pbufferDrawable = new X11PbufferGLXDrawable(this, target); - } finally { - if(usedSharedContext) { - sharedContext.release(); + synchronized(sharedContext) { + sharedContext.makeCurrent(); + try { + pbufferDrawable = new X11PbufferGLXDrawable(this, target); + } finally { + sharedContext.release(); + } } + } else { + pbufferDrawable = new X11PbufferGLXDrawable(this, target); } return pbufferDrawable; } |