Posted by
Sven Gothel on
URL: https://forum.jogamp.org/Thread-blocking-issue-with-AWT-but-not-NEWT-on-OSX-tp4026674p4026710.html
On 11/01/2012 02:06 AM, ac [via jogamp] wrote:
> Ok, I will open a bug report and try to identify the commit that introduced
> the deadlock.
>
> In the meantime, I'll probably need to downgrade to an earlier version of JOGL
> for the next beta release of Processing, since the threading issue is breaking
> video capture. Hopefully we will able to track this one down soon.
>
Analyzing the bug right now.
So I could easily produce the deadlock on OSX - good.
I see:
"AWT-EventQueue-0" prio=6 tid=7fe6758af000 nid=0x119282000 runnable [11927f000]
java.lang.Thread.State: RUNNABLE
at apple.awt.CWindow._setTitle(Native Method)
at apple.awt.CWindow.setTitle(CWindow.java:765)
at java.awt.Frame.setTitle(Frame.java:503)
- locked <7f42b01b8> (a java.awt.Frame)
at com.jogamp.opengl.test.junit.jogl.awt.TestGLCanvasAWTActionDeadlock01AWT.draw(TestGLCanvasAWTActionDeadlock01AWT.java:249)
at com.jogamp.opengl.test.junit.jogl.awt.TestGLCanvasAWTActionDeadlock01AWT$SimpleListener.display(TestGLCanvasAWTActionDeadlock01AWT.java:347)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:373)
- locked <7f3072e58> (a java.lang.Object)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:358)
at javax.media.opengl.awt.GLCanvas$7.run(GLCanvas.java:983)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:655)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:594)
at javax.media.opengl.awt.GLCanvas$8.run(GLCanvas.java:996)
at javax.media.opengl.Threading.invoke(Threading.java:193)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:449)
at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:499)
_and_
"OPENGL" prio=5 tid=7fe67431a000 nid=0x11c3fa000 in Object.wait() [11c3f9000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7f31d11e8> (a java.awt.EventQueue$1AWTInvocationLock)
at java.lang.Object.wait(Object.java:485)
at java.awt.EventQueue.invokeAndWait(EventQueue.java:1106)
- locked <7f31d11e8> (a java.awt.EventQueue$1AWTInvocationLock)
at jogamp.common.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:53)
at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:205)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
at javax.media.opengl.Threading.invoke(Threading.java:191)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:449)
at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:74)
at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:142)
I.e. both threads (AWT-EDT and 'OPENGL') perform a mutable
operation on the native peer - which is illegal so to speak.
Your 'OPENGL' thread is a custom animator based on AnimatorBase,
which does proper registration in the GLDrawable as a AnimatorCtrl.
In GLCanvas we actually try to avoid calling 'display()' if such animator
is running: GLDrawableHelper.isExternalAnimatorAnimating().
Something in this area does not work obviously, cont. finding the culprit.
~Sven