RFR: 8345348: CSS media feature queries [v21]
Michael Strauß
mstrauss at openjdk.org
Tue May 6 18:48:21 UTC 2025
On Tue, 6 May 2025 14:52:49 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> I've moved the `fireValueChangedIfNecessary` out of the synchronized block. We need the synchronized block as a memory barrier to see the latest value of the `effectiveValue` field, as we need to be able to read it from any thread.
>
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1655#discussion_r2076061396
More information about the openjfx-dev
mailing list