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

Leonid Mesnik lmesnik at openjdk.org
Thu Sep 18 05:16:33 UTC 2025


On Thu, 18 Sep 2025 02:42:16 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Really the comment 
>> ```// Sets the suspended state to `to`, applying to vthreads if `register_vthread_SR` is true.```
>> looks incorrect to me. One might decide that the method doesn't set suspend state if for vthreads if `register_vthread_SR` is false. While the method always set suspend and might register or not vthreads to support SuspendAllVirtualThreads.
>
> Okay I was trying to understand exactly what these methods were doing but I'm finding it somewhat difficult to explain that. But my point is to document that the first method sets the state to true/false as directed, whilst the second always sets to true. But it gets harder to describe things when the id variant is only needed when `register_vthread_SR` is true.

The `set_suspended` maintained _suspended flag for individual flags. While to support fast suspending of all virtual threads it uses additional mechanisms.
So, it is rather `set_suspended_status` or something like this. 
I don't know what would be good name for this logic.

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

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


More information about the serviceability-dev mailing list