<?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>952</bug_id>
          
          <creation_ts>2014-01-27 14:00:41 +0100</creation_ts>
          <short_desc>JAWTWindow&apos;s JAWTComponentListener may deadlock due to AWTTreeLock acquisition</short_desc>
          <delta_ts>2014-01-27 18:19:04 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>awt</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>major</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>b7fafd30ffc5eac73880b264043582d74175a394</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3664</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-01-27 14:00:41 +0100</bug_when>
    <thetext>The AWTTreeLock is acquired by Component.removeHierarchyListener
and as for _every_ AWT component, modifications shall happen on the AWT-EDT.

IMHO the user shall offload AWT modifications to the AWT-EDT
similar to what JOGL&apos;s GLCanvas and NEWTCanvasAWT does.

However, since JAWTWindow also represents a NativeWindow instance 
it would not be too bad to offload AWTTreeLock methods ourselves, i.e.:

  boolean wait = false;
  AWTEDTExecutor.singleton.invoke(wait, new Runnable() {
      @Override
      public void run() {
          ... detach .. or attach ..
      } } );


+++

&quot;J3D-Renderer-1&quot; prio=5 tid=0x00007f96dceaf800 nid=0xe103 waiting for monitor entry [0x000000011d9d5000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at java.awt.Component.removeHierarchyListener(Component.java:5383)
	- waiting to lock &lt;0x00000007f8127338&gt; (a java.awt.Component$AWTTreeLock)
	at com.jogamp.nativewindow.awt.JAWTWindow$JAWTComponentListener.detach(JAWTWindow.java:175)
	at com.jogamp.nativewindow.awt.JAWTWindow$JAWTComponentListener.access$600(JAWTWindow.java:123)
	at com.jogamp.nativewindow.awt.JAWTWindow.destroy(JAWTWindow.java:606)
	at javax.media.j3d.JoglDrawable.destroyNativeWindow(JoglDrawable.java:60)
	at javax.media.j3d.JoglPipeline.destroyContext(JoglPipeline.java:6799)
	at javax.media.j3d.Canvas3D.destroyContext(Canvas3D.java:4651)
	at javax.media.j3d.Renderer.removeCtx(Renderer.java:1551)
	- locked &lt;0x00000007f841de58&gt; (a java.lang.Object)
	at javax.media.j3d.Renderer.doWork(Renderer.java:372)
	at javax.media.j3d.J3dThread.run(J3dThread.java:271)


+++


See &lt;http://forum.jogamp.org/JOGL-commit-166e5da-causes-deadlock-errors-in-Java-3D-tp4031305.html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3665</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-01-27 18:17:31 +0100</bug_when>
    <thetext>b7fafd30ffc5eac73880b264043582d74175a394
  Resolved as described</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>