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

Dialog.show() causes deadlocks if placed in synchronized methods.

    Details

    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      solaris_2.4, windows_95

      Description

      You should not call show() on file dialogs or modal dialogs from
      synchronized methods, else there is the very serious potential for
      deadlocks during the modal session. This is because a separate thread
      is spawned to handle the modal loop event dispatching (to avoid potential
      security exceptions) and if you've locked your object before going into
      the modal show loop, when the modal thread dipatches events back up in
      your GUI and attempts to call a synchronized method on your object (as
      a result of the event) it will deadlock, since a separate thread had
      locked it before doing the show (and that thread is waiting for the
      modal thread to finish).

      Amy Fowler

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                amfowler Anne Fowler (Inactive)
                Reporter:
                vssriniv Vijay Srinivasan (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: