RFR: 8357650: ThreadSnapshot to take snapshot of thread for thread dumps [v2]

Alex Menkov amenkov at openjdk.org
Wed May 28 18:18:56 UTC 2025


On Wed, 28 May 2025 12:58:49 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> src/hotspot/share/prims/jvmtiThreadState.hpp line 80:
>> 
>>> 78: // Virtual Thread Mount State Transition (VTMS transition) mechanism
>>> 79: //
>>> 80: class JvmtiVTMSTransitionDisabler : public AnyObj {
>> 
>> Why this change?
>
> It's used by VMThreadSnapshot::get_thread_snapshot. The transition disabling support is currently in the jvmti code. I think this is the first usage in a handshake op that isn't supporting a JVMTI function. Maybe in the future this could be separated.

> Why this change?
To be more clear about the change:
We need JvmtiVTMSTransitionDisabler for virtual threads only, for platform threads handshake is enough. And currently for platform threads JvmtiVTMSTransitionDisabler disables all mount/unmount transitions (and I'd prefer to avoid this).
So we cannot create JvmtiVTMSTransitionDisabler on a stack (this is standard use scenario), but need to create it conditionally by `new`/`delete`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25425#discussion_r2112491335


More information about the hotspot-dev mailing list