Re: [2.0 RC3] PBuffer uses awtlock during display
Posted by gregirvine on Feb 03, 2012; 4:55am
URL: https://forum.jogamp.org/2-0-RC3-PBuffer-uses-awtlock-during-display-tp3355580p3712182.html
Although we're still using JOGL 1.1.1 we're seeing a nearly identical issue when running multithreaded mode - opengl.1thread=false.
It's not related to PBuffers but to the GLCanvas.
Somewhere in the JOGL thread during a display run an AWT lock is performed and when we get a mouse click that results in a popup being opened at the same time we end up with a deadlock.
From what I've read in this discussion and in the bugzilla bug report I'm guessing the lock is happening in the makeCurrent() method called during invokeGL().
We do not see this problem on Windows but only on Linux.
======================================
"Timer-8" Id=106 BLOCKED on <myclass>@7d185d owned by "AWT-EventQueue-0" Id=34
...
com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78)
javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:435)
com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194)
javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:412)
javax.media.opengl.GLCanvas.display(GLCanvas.java:244)
com.sun.opengl.util.Animator.display(Animator.java:144)
com.sun.opengl.util.FPSAnimator$1.run(FPSAnimator.java:95)
java.util.TimerThread.mainLoop(Timer.java:512)
java.util.TimerThread.run(Timer.java:462)
"AWT-EventQueue-0" Id=34 WAITING on java.util.concurrent.locks.ReentrantLock$NonfairSync@1a02ee9 owned by "Timer-8" Id=106
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:842)
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1178)
java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
sun.awt.SunToolkit.awtLock(SunToolkit.java:236)
sun.awt.X11.XWindow.getLocationOnScreen(XWindow.java:1329)
java.awt.Component.getLocationOnScreen_NoTreeLock(Component.java:1939)
java.awt.Component.getLocationOnScreen(Component.java:1917)
javax.swing.JPopupMenu.show(JPopupMenu.java:887)
...
======================================
Upgrading to JOGL2 isn't a simple matter given the project constraints, but do you think the changes made so far would resolve the issue above?
Are the changes easily imported into the jogl1.1.1 base code if we went down that path instead?
Thanks.