OpenJDK / portola / portola
changeset 2650:44d88464a573
6829923: Test javax/swing/system/6799345/TestShutdown.java fails on X11 platforms
Summary: XAWT toolkit thread is correctly interrupted when AppContext is disposed
Reviewed-by: anthony, peterz
author | art |
---|---|
date | Fri, 17 Apr 2009 12:46:24 +0400 |
parents | 903fd9d785ef |
children | c6612086e8c9 |
files | jdk/src/solaris/classes/sun/awt/X11/XToolkit.java |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Fri Apr 10 11:51:36 2009 +0900 +++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Fri Apr 17 12:46:24 2009 +0400 @@ -565,6 +565,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) {