--- a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java Fri May 15 12:06:22 2009 +0400
+++ b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java Fri May 15 17:26:45 2009 +0400
@@ -478,21 +478,22 @@
public <T> T invoke(Callable<T> task) {
try {
- T result;
if (Thread.currentThread() == comThread) {
// if it's already called from the COM
// thread, we don't need to delegate the task
- result = task.call();
+ return task.call();
} else {
- Future<T> future = submit(task);
- try {
- result = future.get();
- } catch (InterruptedException e) {
- result = null;
- future.cancel(true);
+ while (true) {
+ Future<T> future = submit(task);
+
+ try {
+ return future.get();
+ } catch (InterruptedException e) {
+ // Repeat the attempt
+ future.cancel(true);
+ }
}
}
- return result;
} catch (Exception e) {
Throwable cause = (e instanceof ExecutionException) ? e.getCause() : e;
if (cause instanceof RuntimeException) {