RFR: 8307153: JVMTI GetThreadState on carrier should return STATE_WAITING [v4]

Alex Menkov amenkov at openjdk.org
Tue Jun 6 23:44:55 UTC 2023


On Tue, 6 Jun 2023 22:41:54 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> When a virtual thread is mounted, the carrier thread should be reported as "waiting" until the virtual thread unmounts. Right now, GetThreadState reports a state based the JavaThread status when it should return JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY.
>> The fix adds:
>>  - a special case for passive carrier threads
>>  - necessary test coverage to the existing JVMTI test: `serviceability/jvmti/vthread/ThreadStateTest`.
>> 
>> Testing:
>>    - tested with the updated test: `serviceability/jvmti/vthread/ThreadStateTest`
>>    - submitted mach5 tiers 1-5
>>    - TBD: to submit mach5 tier 6
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review: call get_thread_state_base only when needed

Marked as reviewed by amenkov (Reviewer).

src/hotspot/share/prims/jvmtiEnvBase.hpp line 386:

> 384: 
> 385:   // get platform thread state
> 386:   static jint get_thread_state_base(oop thread_oop, JavaThread* jt);

maybe rename it to `get_platform_thread_state`?

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

PR Review: https://git.openjdk.org/jdk/pull/14298#pullrequestreview-1466301122
PR Review Comment: https://git.openjdk.org/jdk/pull/14298#discussion_r1220543652


More information about the serviceability-dev mailing list