On Tue, 3 Mar 2026 08:03:21 GMT, Lukasz Kostyra <[email protected]> wrote:

>> modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/PrismInvoker.java
>>  line 83:
>> 
>>> 81: 
>>> 82:     private static boolean isOnRenderThread() {
>>> 83:         return 
>>> Thread.currentThread().getName().startsWith("QuantumRenderer");
>> 
>> There are two more files with a similar check (`Disposer`, `NGCanvas`) - do 
>> you think  there should be a utility method for it?
>> 
>> Also, is there a better, faster way other than `startsWith()`?
>
> Yes I think there probably should be, and there also probably is a better 
> way. I'm also not a big fan of just checking thread's name, especially if we 
> need to change it for any reason. When working on this bug I stumbled upon an 
> ancient enhancement about this - 
> [JDK-8090484](https://bugs.openjdk.org/browse/JDK-8090484) - so it seems 
> there were at least some theorized attempts to improve this part.
> 
> I would consider it out of scope of this change though and improve this 
> separately (probably as a part of the above issue), it almost certainly would 
> be a larger improvement reaching over to graphics module.
> 
> **EDIT:** Also, regarding `Disposer` - I suspect you meant the one residing 
> in graphics under `com/sun/prism/impl/Disposer.java`. We seem to have quite a 
> bit of Disposers in the code base...

definitely out of scope for this PR.

since it's a real (non-virtual) thread, we could create a thread of specific 
type and just check `if(Thread.currentThread().getClass == 
QuantumRenderer.class)` ?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2092#discussion_r2878903022

Reply via email to