Bug 139 - Deadlock involving AWT Treelock
Summary: Deadlock involving AWT Treelock
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 1
Hardware: All windows
: P4 normal
Assignee: Sven Gothel
Depends on:
Reported: 2005-02-11 08:50 CET by Sven Gothel
Modified: 2010-03-24 07:47 CET (History)
0 users

See Also:
SCM Refs:
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2010-03-24 07:47:27 CET

---- Reported by s_koehler 2005-02-11 20:50:52 ----


if you use an AnimatorThread, the following DeadLock may occur. Here are the two
StackTraces of the Threads that may run into the DeadLock.

1. GLCanvas.reshape() called with AWT-TreeLock held
2. GLCanvas.withSingleThreadedWorkaroundDo()
3. GLContext.invokeGL() which tries to obtain the Monitor of the GLContext

1. GLContext.invokeGL() obtains the Monitor the GLContext
2. WindowsGLContext.makeCurrent()
3. WindowsOff/OnScreenContext.create()
4. WindowsGLContext.choosePixelFormatAndCreateContext()
5. java.awt.Component.getGraphicsConfiguration() which tried to get the SWT

This is a perfect deadlock ;-)

---- Additional Comments From kbr 2005-02-12 11:38:12 ----

A workaround for this specific deadlock, which was introduced along with the new
pixel format selection code for Windows (including FSAA support), was added in
1.1 b08. I don't think the scenario described can happen because
WindowsOnscreenGLContext overrides invokeGL precisely to prevent this from
happening. I'm closing this bug as invalid because I don't think it has been
reproduced with 1.1 b08. If I am wrong, please reopen it and either attach a
test case or provide the thread dump from a 1.5.0 HotSpot (Ctrl-Break on Windows).

---- Additional Comments From s_koehler 2005-02-12 12:28:40 ----

Thx for the answer. I cannot reliably reproduce the deadlock, since it is
depends on a race to happen. I tried to figure out whether the deadlock can
happen by looking at the source of JOGL 1.1b8. Obviously i didn't notice that
you've overriden invokeGL in WindowsOnScreenGLContext. That code should solve
the problem.


--- Bug imported by sgothel@jausoft.com 2010-03-24 07:47 EDT  ---

This bug was previously known as _bug_ 139 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=139