On Fri, 20 Feb 2026 20:58:24 GMT, Serguei Spitsyn <[email protected]> wrote:

>> src/hotspot/share/prims/jvmtiEnv.cpp line 1083:
>> 
>>> 1081:     // It must be suspended in the suspend_thread call out of 
>>> disabler context.
>>> 1082:     oop cur_oop = self_tobj();
>>> 1083:     if (cur_oop != nullptr && 
>>> JvmtiVTSuspender::is_vthread_suspended(cur_oop)) {
>> 
>> Shouldn't `JvmtiVTSuspender::is_vthread_suspended(cur_oop)` always be true? 
>> Also (preexistent) above when we iterate `elist`?
>
> Thank you for checking. Current virtual thread can be in the `except_list`. 
> Then it has already been resumed at the line 1077.

But if it's in the list then `self_tobj()` should be `nullptr`, i.e non 
`nullptr` implies it must be suspended. We could just add it as an assert 
inside the conditional.
Also when iterating the `elist` above, we just called 
`JvmtiVTSuspender::register_all_vthreads_suspend()` so 
`JvmtiVTSuspender::is_vthread_suspended` should be true for all vthreads.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29802#discussion_r2835326433

Reply via email to