RFR: 8349098: TabPane: exception initializing in a background thread [v2]

Ambarish Rapte arapte at openjdk.org
Thu Feb 13 12:48:20 UTC 2025


On Fri, 7 Feb 2025 18:42:01 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> ## Root Cause
>> Animation gets started in a background thread, which causes the animation handler to run in the FX application thread, thus creating simultaneous access to the control's fields (list of children in this case).
>> 
>> ## Solution
>> Skip the animation.
>> 
>> The fix is similar to https://github.com/openjdk/jfx/pull/1698
>
> 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 branch 'master' into 8349098.thread.safe.tabpane
>  - skip animation

modules/javafx.controls/src/main/java/javafx/scene/control/skin/TabPaneSkin.java line 523:

> 521:                 };
> 522: 
> 523:                 if (Platform.isFxApplicationThread() && (closeTabAnimation.get() == TabAnimation.GROW)) {

With this check, non Application thread cannot play the animation but in else block the `cleanup` is executed on the same thread.
Can there still be a situation when, this non-Application thread and Application thread be concurrently modifying the tab?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1699#discussion_r1954431776


More information about the openjfx-dev mailing list