RFR: 8309612: [REDO] JDK-8307153 JVMTI GetThreadState on carrier should return STATE_WAITING [v4]

David Holmes dholmes at openjdk.org
Thu Jun 8 02:09:48 UTC 2023


On Thu, 8 Jun 2023 01:40:06 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> The INTERRUPTED bit we need has to be returned by the `java_lang_Thread::get_thread_status`.
>> Not completely sure but the bit jt->is_interrupted(false) can be set for the mounted virtual thread.
>> The JVMTI InterruptThread calls this function to set interrupt bit for non-virtual threads:
>> `  java_lang_Thread::set_interrupted(thread_obj, true);`
>
> Corrected the function `get_thread_state()` to make it more safe.
> Only `ALIVE` and `INTERRUPTED` bits are taken from result of `java_lang_Thread::get_thread_status(thread_oop)`.

> A thread carrying a virtual thread can not be in native, blocked, parked, sleeping or waiting on some object.

A virtual thread can call native code, be blocked on an object monitor, or waiting on an object monitor. Only parking and sleeping are specialized for virtual threads in the list you gave.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14366#discussion_r1222364495


More information about the serviceability-dev mailing list