RFR: 8334215: serviceability/dcmd/thread/PrintMountedVirtualThread.java failing with JTREG_TEST_THREAD_FACTORY=Virtual [v2]
Inigo Mediavilla Saiz
duke at openjdk.org
Mon Jun 17 13:24:23 UTC 2024
On Mon, 17 Jun 2024 13:15:27 GMT, Inigo Mediavilla Saiz <duke at openjdk.org> wrote:
>>> We need a comment explaining why we have to check for this as without knowing the implementation quirks it seems non-sensical for a thread to have mounted itself!
>>
>> Just to note that JavaThread._vthread is always the "current thread". It's the virtual thread when mounted, the carrier (as in itself) when there is no virtual thread mounted. It's done this way so that the C2 instrinic for currentThread doesn't need a branch/test.
>
> I wasn't aware of that, and I was going to suggest to add that information as documentation, but it seems to be already documented here: https://github.com/openjdk/jdk/blob/ad0b54d429fdbd806c09aa06bb42f1ed4a0297e8/src/hotspot/share/runtime/javaThread.hpp#L95
I've still clarified why the `if` is required in 9a954efe164d9caee31494773c0eecc8ff69223f
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19744#discussion_r1642807104
More information about the serviceability-dev
mailing list