On Tue, 6 May 2025 18:45:47 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

>> Maybe a `volatile` would be a better choice then?
>
> `volatile` is not enough, because the different values are correlated (for 
> example `foreground`, `background`, and `colorScheme`). All values need to be 
> updated in a single transaction, as otherwise we could end up reading a 
> transient combination of values.

I see.  The I suggest we enforce single-threaded nature of it: everything must 
happen in the FX Application Thread.  I don't think it's a good idea to start 
synchronizing things in FX now all of a sudden.

Any code that wants to access FX from a background thread must do so using a 
combination of `runLater` and a `CountDownLatch`.

What do you think?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1655#discussion_r2076069191

Reply via email to