Re: JOGL/JDK7 RC10+ Display Issue, With Test Case

Posted by rhatcher on
URL: https://forum.jogamp.org/JOGL-JDK7-RC10-Display-Issue-With-Test-Case-tp4025819p4025825.html

Possible workaround (?):

I attempted to reproduce this problem with Java2D without JOGL in the loop but couldn't make it fail.

This pointed another finger at the GLProfile initSingleton method's indirect interruption of the event dispatch thread as the triggering event that eventually leads to the hangs, so I took a closer look at this method and noticed that its javadoc said:

"Applications using this method may place it's (sic) call before any other UI invocation in the main class's static block or within the main function.  In such case, applications may pass firstUIActionOnProcess=true to use native toolkit locking."

Based on this suggestion I added a call to GLProfile.initSingleton() to the test app as one of the earliest things it does and this hang problem seems to have disappeared in JDK7.  GLProfile.initSingleton(true) also worked, though it is deprecated.  This also seems to fix the similar issue I was having in our full-up software set.

I'm not sure what this says about how GLProfile.initSingleton() works.  I'm still inclined to believe this is a race in JDK7's AWT that initSingleton() just happened to stimulate at the wrong time.


Is there any disadvantage to making the initSingleton call early?  If not then I'm going to forge ahead with this workaround.