On Mon, 4 Dec 2023 06:31:43 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> Daniel D. Daugherty has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   dholmes CR - adjust a comment.
>
> Initially I thought this was not the right fix as we should not be exposing 
> an attaching thread that may still have a partially constructed `threadObj`. 
> But this issue shows that we must expose such a thread because the 
> constructor of the `Thread` object can trigger these events on the current 
> thread so it must have a valid JVMTI state!
> 
> Thanks.

@dholmes-ora - Thanks for the review.

> src/hotspot/share/prims/jvmtiThreadState.inline.hpp line 90:
> 
>> 88:     // Don't add a JvmtiThreadState to a thread that is exiting or is 
>> attaching.
>> 89:     // When a thread is attaching, it may not have a Java level thread 
>> object
>> 90:     // created yet.
> 
> The comment needs adjusting now - suggestion:
> 
> // Don't add a JvmtiThreadState to a thread that is exiting, or is attaching
> // and does not yet have a Java level thread object allocated.

Thanks for the suggested change. I agree and I've applied it.

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

PR Comment: https://git.openjdk.org/jdk/pull/16934#issuecomment-1839205636
PR Review Comment: https://git.openjdk.org/jdk/pull/16934#discussion_r1414306493

Reply via email to