Is this problem related to the problem described in the bug report about the 
refresh problem shown at http://www.segal.org/java/refresh4/ ?  

Apple seems to have concluded this is Oracle's problem and Oracle seems to have 
concluded this is Apple's problem.

Petr Pchelko wrote:

It's known that there are some deadlocks in SWT_AWT bridge on Mac. Here's an 
example:
https://bugs.openjdk.java.net/browse/JDK-8020165

It would be useful if you also post the dump of an Appkit thread to identify 
your particular case.

The deadlock occurs because AWT is called on the main thread. So the main 
thread get blocked on some internal AWT lock, while the EventDispatchThread is 
trying to perform a synchronous operation on the main thread. It's not quite 
obvious how to fix that internally, because for the normal AWT application we 
have a strict rule not to acquire locks on the Appkit thread. 

For now the workaround could be to wrap all the usages of AWT inside 
invokeLater (except the initial
SWT_AWT.new_Frame(composite) call). This should fix your deadlock. 

Also, which version of SWT are you using? The newer versions are patched so 
that you could not set the embeddedFrameClass explicitly. That patch also 
contains additional changes in bridge initialization, so the bridge does not 
work quite well with older versions. This could be another reason of your 
deadlock. 

Reply via email to