-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.0.2, 1.1.6
-
x86, sparc
-
solaris_2.4, windows_95
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
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
- duplicates
-
JDK-4006955 Over riding dialog show will cause a hang on Solaris.
- Closed
-
JDK-4073042 Modal dialogs can't be used in contexts where Component.LOCK has been acquired
- Closed