public final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException { switch (ThreadingImpl.getMode()) { case ST_AWT: // FIXME: ideally should run all OpenGL work on the Java2D QFT // thread when it's enabled, but unfortunately there are // deadlock issues on X11 platforms when making our // heavyweight OpenGL contexts current on the QFT because we // perform the JAWT lock inside the makeCurrent() // implementation, which attempts to grab the AWT lock on the // QFT which is not allowed. For now, on X11 platforms, // continue to perform this work on the EDT. if (wait && Java2D.isOGLPipelineActive() && !ThreadingImpl.isX11()) { if (wait) { Java2D.invokeWithOGLContextCurrent(null, r); } else { } } else { AWTEDTExecutor.singleton.invoke(wait, r); } break; case ST_WORKER: ThreadingImpl.invokeOnWorkerThread(wait, r); break; default: throw new InternalError("Illegal single-threading mode " + ThreadingImpl.getMode()); } }