RFR: 8345348: CSS media feature queries [v21]

Andy Goryachev angorya at openjdk.org
Tue May 6 14:55:25 UTC 2025


On Tue, 6 May 2025 07:33:07 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/javafx/application/preferences/PreferenceProperties.java line 184:
>> 
>>> 182: 
>>> 183:             for (DeferredProperty<?> property : deferredProperties.values()) {
>>> 184:                 property.fireValueChangedIfNecessary();
>> 
>> firing events from a synchronized method is a recipe for a lockup.
>> JavaFX is still a single threaded toolkit (if we ignore the creation of certain objects aspect), why do we want to synchronize?
>
> 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?

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

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


More information about the openjfx-dev mailing list