RFR: 8305352: updateIconImages may lead to deadlock after JDK-8276849

Alexey Ivanov aivanov at openjdk.org
Fri Apr 21 16:38:48 UTC 2023


On Fri, 31 Mar 2023 18:29:01 GMT, Phil Race <prr at openjdk.org> wrote:

> Even for AWT (non-swing) apps, it is recommended to do it on the EDT to avoid threading issues - such as this. Lots of apps do use the main thread, and have no issues but that's not guaranteed.
> 
> I can't find where this is documented .. I do remember it was quite a number of years ago that this advice was first offered.

I tried to find any documentation stating the threading model for AWT components but I didn't find any. I presume AWT should be thread-safe. A couple of times on code review I saw it had been proposed to drop `EventQueue.invokeLater` because creating and changing AWT components from main thread is _safe_.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13263#issuecomment-1518078254



More information about the client-libs-dev mailing list