diff options
Diffstat (limited to 'src/net/java/games/jogl/impl/GLPbufferImpl.java')
-rw-r--r-- | src/net/java/games/jogl/impl/GLPbufferImpl.java | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/net/java/games/jogl/impl/GLPbufferImpl.java b/src/net/java/games/jogl/impl/GLPbufferImpl.java index fbbf6c519..35a8ac79f 100644 --- a/src/net/java/games/jogl/impl/GLPbufferImpl.java +++ b/src/net/java/games/jogl/impl/GLPbufferImpl.java @@ -198,22 +198,9 @@ public class GLPbufferImpl implements GLPbuffer { private void maybeDoSingleThreadedWorkaround(Runnable eventDispatchThreadAction, Runnable invokeGLAction, boolean isReshape) { - if (SingleThreadedWorkaround.doWorkaround() && !EventQueue.isDispatchThread()) { - try { - // Reshape events must not block on the event queue due to the - // possibility of deadlocks during initial component creation. - // This solution is not optimal, because it changes the - // semantics of reshape() to have some of the processing being - // done asynchronously, but at least it preserves the - // semantics of the single-threaded workaround. - if (!isReshape) { - EventQueue.invokeAndWait(eventDispatchThreadAction); - } else { - EventQueue.invokeLater(eventDispatchThreadAction); - } - } catch (Exception e) { - throw new GLException(e); - } + if (SingleThreadedWorkaround.doWorkaround() && + !SingleThreadedWorkaround.isOpenGLThread()) { + SingleThreadedWorkaround.invokeOnOpenGLThread(eventDispatchThreadAction); } else { drawableHelper.invokeGL(pbufferDrawable, context, invokeGLAction, initAction); } |