Pardon for taking so long to reply. Just for fun, I checked out the
0.5.0 source and poked around. After a few minutes of looking at the
source and the jstack ouput I found the problem. In Cockpit.java
(compareRemoteAndLocalFiles()) there's a call to stopProgressDisplay()
from a Runnable. This calls dispose(), which eventually tries to grab
the lock on member variable progressDisplay. Problem is, that doesn't
take place in the AWT thread, and a few lines up there's a
startProgressDisplay() that grabs the lock in a synchronized method.
Result: instant deadlock of that worker thread.
Wrapping the stopProgressDisplay() in a SwingUtilities.invokeAndWait()
seems to fix it:
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
stopProgressDisplay();
}
});
I think SwingUtilities wasn't included in the JDK until 6.0, but
there's a version of it in the Java tutorial, if memory serves. I'm
sure there are other backports.
Would you like me to deliver this change in a more serviceable format?
As a patch? If you've taken care of it in 0.5.1 that's fine; I wonder
if others have the same problem with the 0.5.0 version running on JDK
6.0 though. Let me know.
John
> > at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
> > - locked <0x22f9d6a8> (a java.lang.ref.ReferenceQueue$Lock)
> > at
> > org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
> > $ReferenceQueueThread.run(MultiThreadedHttpConnectionManager.java:
> > 1082)
>
> > "DestroyJavaVM" prio=6 tid=0x00296800 nid=0xa5c waiting on condition
> > [0x00000000..0x0090fd4c]
> > java.lang.Thread.State: RUNNABLE
>
> > "AWT-EventQueue-0" prio=6 tid=0x02fa4c00 nid=0x514 in Object.wait()
> > [0x0374f000..0x0374fb94]
> > java.lang.Thread.State: WAITING (on object monitor)
> > at java.lang.Object.wait(Native Method)
> > at java.lang.Object.wait(Object.java:485)
> > at java.awt.EventQueue.getNextEvent(EventQueue.java:479)
> > - locked <0x22e81d70> (a java.awt.EventQueue)
> > at
> > java.awt.EventDispatchThread.pumpOneEventForFilters(
> > EventDispatchThread.java:
> > 245)
> > at
> > java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
> > 183)
> > at
> > java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
> > 177)
> > at java.awt.Dialog$1.run(Dialog.java:1045)
> > at java.awt.Dialog$3.run(Dialog.java:1097)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at java.awt.Dialog.show(Dialog.java:1095)
> > at org.jets3t.apps.cockpit.gui.ProgressDisplay
> > $1.run(ProgressDisplay.java:90)
> > - locked <0x229b28d0> (a
> > org.jets3t.apps.cockpit.gui.ProgressDisplay
> > $ProgressDialog)
> > at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java
> > :209)
> > at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
> > at
> > java.awt.EventDispatchThread.pumpOneEventForFilters(
> > EventDispatchThread.java:
> > at sun.awt.windows.WToolkit.eventLoop(Native Method)
> > at sun.awt.windows.WToolkit.run(WToolkit.java:290)
> > at java.lang.Thread.run(Thread.java:619)
>
> > "AWT-Shutdown" prio=6 tid=0x02df0800 nid=0xfcc in Object.wait()
> > [0x0307f000..0x0307fb14]
> > java.lang.Thread.State: WAITING (on object monitor)
> > at java.lang.Object.wait(Native Method)
> > at java.lang.Object.wait(Object.java:485)
> > at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
> > - locked <0x22ea0098> (a java.lang.Object)
> > at java.lang.Thread.run(Thread.java:619)
>
> > "Java2D Disposer" daemon prio=10 tid=0x02dec400 nid=0x9f8 in
> > Object.wait() [0x0302f000..0x0302fb94]
> > java.lang.Thread.State: WAITING (on object monitor)
> > at java.lang.Object.wait(Native Method)
> > - waiting on <0x22ea0128> (a java.lang.ref.ReferenceQueue$Lock)
> > at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)