--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Tue Apr 28 13:30:42 2009 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Tue Apr 28 13:41:11 2009 -0700
@@ -568,6 +568,17 @@
{
XEvent ev = new XEvent();
while(true) {
+ // Fix for 6829923: we should gracefully handle toolkit thread interruption
+ if (Thread.currentThread().isInterrupted()) {
+ // We expect interruption from the AppContext.dispose() method only.
+ // If the thread is interrupted from another place, let's skip it
+ // for compatibility reasons. Probably some time later we'll remove
+ // the check for AppContext.isDisposed() and will unconditionally
+ // break the loop here.
+ if (AppContext.getAppContext().isDisposed()) {
+ break;
+ }
+ }
awtLock();
try {
if (loop == SECONDARY_LOOP) {