RFR: 8366659: ObjectMonitor::wait() liveness problem with a suspension request [v24]
Anton Artemov
aartemov at openjdk.org
Tue Jan 20 09:04:07 UTC 2026
On Tue, 20 Jan 2026 00:49:19 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8366659: Addressed reviewers' comments, added comments, renamed tests.
>
> src/hotspot/share/runtime/objectMonitor.cpp line 2296:
>
>> 2294: // unparked directly in notify_internal(). Its state is then TS_RUN.
>> 2295: if (state == ObjectWaiter::TS_RUN) {
>> 2296: bool acquired = vthread_monitor_enter(current, node);
>
> If we get here due to the direct unpark is it possible for `acquired` to be false? If so then I think the else clause starting at line 2312 below will be incorrect - it expects the thread to be on the entry list which it won't be.
The else clause at line 2312 pairs with `if (state == ObjectWaiter::TS_RUN)` statement, there are only two possibilities, either TS_RUN, or TS_ENTER, the latter implies that the thread is on the `entry_list`.
If `acquired` is false when handling TS_RUN case, it is fine, the whole method will return false at line 2316.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2707399555
More information about the hotspot-runtime-dev
mailing list