RFR: 8369250: Assess and remedy any unsafe usage of the Semaphore used by NonJavaThread::List

Kim Barrett kbarrett at openjdk.org
Tue Oct 7 07:15:50 UTC 2025


On Tue, 7 Oct 2025 07:09:55 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/runtime/nonJavaThread.hpp line 49:
>> 
>>> 47:   }
>>> 48: 
>>> 49:   NonJavaThread* volatile _next;
>> 
>> Is there a reason why the code couldn't stay in the .cpp file?
>
> Yes, we need a complete class definition of `T` available when we declare the `DeferredStatic<T>`.

But we could instead have in the header

void non_java_threads_list_init();

and in the .cpp file

void non_java_threads_list_init() { NonJavaThread::init(); }

which is an idiom we frequently use elsewhere.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27664#discussion_r2409621459


More information about the hotspot-runtime-dev mailing list