On Wed, 16 Apr 2025 16:35:39 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> Andy Goryachev has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains two additional >> commits since the last revision: >> >> - Merge remote-tracking branch 'origin/master' into 8088343.lifecycle >> - 8088343 > > modules/javafx.graphics/src/main/java/javafx/concurrent/Task.java line 1041: > >> 1039: } >> 1040: }); >> 1041: return rv.get(); > > This is ineffective since you don't wait for the runLater to execute (and > waiting could lead to deadlock, so I wouldn't recommend that). I don't think > there is anything better than unconditionally returning `flag` when not > running on the FX app thread. That's what the current code does (and is what > your proposed fix will do most of the time). good point! In this particular case, returning `true` from `cancel()` when state will not be changed is acceptable. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1769#discussion_r2047689677