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

Kevin Rushforth kcr at openjdk.org
Fri Feb 14 16:15:15 UTC 2025


On Thu, 13 Feb 2025 12:45:20 GMT, Ambarish Rapte <arapte at 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 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?

If you mean two threads accessing this same TabPaneSkin instance, then that's not a valid case. JavaFX objects are not thread-safe when accessed from multiple threads. This bug (and the other related bugs fixed or under review) is about making sure that multiple threads, including the JavaFX application thread, each concurrently accessing their own instance, don't interfere with each other.

So it would only be a problem if "cleanup" attempted some animation or touched static state or similar, which is doesn't look like it does.

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

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


More information about the openjfx-dev mailing list