On Mon, 5 May 2025 15:17:32 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
>> Michael Strauß has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 30 commits: >> >> - Merge branch 'master' into feature/media-queries >> - cssref doc >> - Merge branch 'master' into feature/media-queries >> - reorder fields >> - remove ReadOnlyBooleanWrapper >> - Scene preferences only actively observe platform preferences when the >> scene is showing >> - formatting >> - typo >> - use equality instead of identity >> - rename TokenStream methods >> - ... and 20 more: https://git.openjdk.org/jfx/compare/498b7e4c...626a904d > > 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. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1655#discussion_r2074888025