<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>139</bug_id>
          
          <creation_ts>2005-02-11 08:50:52 +0100</creation_ts>
          <short_desc>Deadlock involving AWT Treelock</short_desc>
          <delta_ts>2010-03-24 07:47:27 +0100</delta_ts>
          <reporter_accessible>0</reporter_accessible>
          <cclist_accessible>0</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>windows</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>155</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 07:47:27 +0100</bug_when>
    <thetext>


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

Hi,

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

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

Thread2:
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
TreeLock.

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&apos;t think the scenario described can happen because
WindowsOnscreenGLContext overrides invokeGL precisely to prevent this from
happening. I&apos;m closing this bug as invalid because I don&apos;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&apos;t notice that
you&apos;ve overriden invokeGL in WindowsOnScreenGLContext. That code should solve
the problem.

Thx
  Sven



--- 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
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>