On Thu, 13 Feb 2025 12:45:20 GMT, Ambarish Rapte <ara...@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

Reply via email to