RFR: 8269466: Factor out the common code for initializing and starting internal VM JavaThreads [v2]
David Holmes
david.holmes at oracle.com
Thu Jul 1 01:59:03 UTC 2021
On 1/07/2021 4:56 am, Coleen Phillimore wrote:
> On Wed, 30 Jun 2021 18:44:33 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>
>>> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>>>
>>> Fixed copyright years in hpp files
>>
>> src/hotspot/share/runtime/thread.cpp line 3935:
>>
>>> 3933: // in that case. However, since this must work and we do not allow
>>> 3934: // exceptions anyway, check and abort if this fails.
>>> 3935: if (thread == nullptr || thread->osthread() == nullptr) {
>>
>> thread shouldn't be NULL here if you haven't used a nothrow version of new to allocate the thread.
>
> Since you're no longer holding the JavaThreads_lock here, it seems like you could do this from the JavaThread constructor instead of adding this function. Except for the case for the JFR thread and JVMTI. So maybe you need this.
This code is only for system Java Thread's where failure to initialize
during VM init (very unlikely) will abort the VM. It doesn't apply to
all system JavaThread's nor the JavaThread's we create in response to
starting java.lang.Thread instances.
> Maybe fix the comment at the end of JavaThread constructor that says you're holding a lock and are going to throw OOM and those details.
What comment ??
Thanks,
David
> -------------
>
> PR: https://git.openjdk.java.net/jdk/pull/4629
>
More information about the hotspot-compiler-dev
mailing list