On Mon, 24 Jul 2023 16:08:07 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

>> 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.

No doubt.  `dnd`, even though it's commented as "// Accessed on EDT only" (line 
152) seems to be accessed from FX thread via setFxEnabled line 866.
I tend to agree with @mstr2 that this component deserves a re-think and perhaps 
a re-design.  I do recall seeing a number of issues with swing/fx interop in 
jdk8.

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

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

Reply via email to