<AWT Dev> deadlock between AppKit main thread and AWT event thread in JDK 17

Michael Hall mik3hall at gmail.com
Mon Jun 28 14:43:47 UTC 2021



> On Jun 28, 2021, at 9:30 AM, Alan Snyder <javalists at cbfiddle.com> wrote:
> 
> My code (#2) running on the AWT thread is blocked trying to perform selector on main thread waiting YES. It is blocked because it does not specify that it can be run under the javaRunLoopMode. It specifies the AWTRunLoopMode, which is the old name. That name is supplied by JavaNativeFoundation.

Sorry for mostly noise on this.
I’m again not familiar with the JNF that requires the run loop name.

> 
> The main thread is blocked waiting for an upcall to Java to get accessibility information, which is blocked waiting for code to run on the AWT thread.
> 
> Neither thread can proceed until the other one completes its operation. Hence, a deadlock.

> 
> In both cases, “blocked” is a soft block, because both threads are running a nested run loop, but the conditions for exiting those run loops are not met.

OK. 

> 
> The run loop name used by AWT needs to be part of the public API of the JDK.

Offhand I see no reason AWT discontinuing use of JNF itself would require this name change. If 3rd party code requires the run loop name and the jdk continues to have such a name without JNF they should have it available somewhere. 

JNF itself without AWT using it seems to me will probably not have a lot of ongoing support and could be difficult to continue using. I had a little trouble a little while ago where I no longer had a framework that provided it and had to resort to using what the Xcode SDK provided. If that is discontinued? 




More information about the awt-dev mailing list