RFR: 8367725: Incorrect reading of oop in SuspendResumeManager::suspend while thread is blocked [v9]

Leonid Mesnik lmesnik at openjdk.org
Wed Sep 17 20:14:46 UTC 2025


On Wed, 17 Sep 2025 19:48:21 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> src/hotspot/share/runtime/suspendResumeManager.cpp line 104:
>> 
>>> 102:     ThreadBlockInVM tbivm(self);
>>> 103:     MutexLocker ml(_state_lock, Mutex::_no_safepoint_check_flag);
>>> 104:     set_suspended_with_id(id, register_vthread_SR);
>> 
>> Nit: I'd prefer to have the same function name overloaded with a different parameter type. Then it will be consistent with `JvmtiVTSuspender::register_vthread_suspend(*)` overloaded functions.
>> There can be different opinions here, of course.
>
> Renaming it to `self_suspend()` is also a good choice IMHO. :)

The 'self_suspend' is the first attempt, but I agree with @pchilano that it is better to have something similar to
'set_suspended' since the method is doing the same. It not fully suspend but only set status. 
The another possible name that might be:
'set_suspended_current_thread'
to make clear that it is for "self suspension" purpose only.
while the 'with_id' part is clear from the parameters.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27317#discussion_r2356664409


More information about the serviceability-dev mailing list