On Mon, 15 Jul 2024 23:03:10 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

>> This is unrelated to the current bug, since all accesses are happening on 
>> the FX app thread, so I'd like to file a follow-up to look into this.
>> 
>> To answer the question, there might be a potential problem with other 
>> threads not seeing that the `Application.application` field has been set to 
>> null.
>> 
>> Other threads do not access the glass Application directly. Most methods 
>> requires the app to be on the application thread, and will correctly detect 
>> and fail whether they see the old or new value of `Application.application`, 
>> so those operations will be fine.
>> 
>> One scenario that should be examined is `Platform.runLater`, which could 
>> call into glass and see the old value of application. There are related 
>> fields in `Tooklit` (e.g., the `fxUserThread` variable) that ought to be 
>> examined at the same time.
>
>> since all accesses are happening on the FX app thread
> 
> Not quite right: the following threads access the field, apart from JavaFX 
> Application Thread:
> 
> 
> thread=JavaFX-Launcher
> thread=Thread-2
> thread=PulseTimer-CVDisplayLink thread
> thread=QuantumRenderer-0
> 
> 
> The output above logs thread names that access `Application.application` 
> field, running the reproducer attached to both tickets.

To clarify, I'm talking about the accesses that have anything to do with this 
bug, and specifically, the methods that I modified. Those are all on the FX 
application thread. Unrelated to this bug, there are plenty of calls to 
Platform.runLater on other threads, which will indeed access the 
`Application.application` field from that other thread.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1506#discussion_r1678502901

Reply via email to