RFR: 8255248: NullPointerException in JFXPanel due to race condition in HostContainer [v3]

Michael Strauß mstrauss at openjdk.org
Mon Jul 24 16:10:51 UTC 2023


On Mon, 24 Jul 2023 14:48:57 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> ok
>
> this code looks much better - eliminates TOC/TOU concern
> https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use

This code is still accessing shared state (`dnd`, `pWidth`, `pHeight`, `scaleFactorX`, `scaleFactorY`). Without further analysis of when and where these values are written, it is unclear whether this is the right move. In general, allowing interleaved code execution on multiple threads is very hard to get right. Better to not do it, if at all possible.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1178#discussion_r1272472480


More information about the openjfx-dev mailing list