Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4924424

Window.dispose() under TreeLock causes deadlock

XMLWordPrintable

    • generic, x86
    • generic, windows_98, windows_xp

      The following minimized sample deadlocks

      import java.awt.*;

      public class Dispose {
          public static void main(String[] args) {
              Frame frame = new Frame();
              frame.setSize(100, 100);
              frame.setVisible(true);
              synchronized (frame.getTreeLock()) {
                   frame.dispose();
              }
          }
      }

      If user calls dispose from some awt method which holds TreeLock it
      causes deadlock even if the user code doesn't get TreeLock itself.

            dmikhalksunw Denis Mikhalkin (Inactive)
            ssisunw Ssi Ssi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: