RFR: 8366659: ObjectMonitor::wait() liveness problem with a suspension request [v20]
David Holmes
dholmes at openjdk.org
Tue Jan 20 00:14:27 UTC 2026
On Mon, 19 Jan 2026 11:14:41 GMT, Anton Artemov <aartemov at openjdk.org> wrote:
>> src/hotspot/share/runtime/objectMonitor.cpp line 1932:
>>
>>> 1930: // (Don't cache naked oops over safepoints, of course).
>>> 1931:
>>> 1932: // post monitor waited event. Note that this is past-tense, we are done waiting.
>>
>> Suggestion:
>>
>> // Post monitor waited event. Note that this is past-tense, we are done waiting.
>>
>> You need to expand the comment to explain the significance of checking for TS_ENTER.
>
> Addressed.
You didn't expand the comment. IIUC if the state is TS_ENTER then we were notified and moved from TS_WAIT to TS_ENTER before being unparked. But, again IIUC, that will only happen if we don't have to post the event else the notification will unpark us directly and move us to TS_RUN. Which means that checking `!= TS_ENTER` is redundant because if we should post the event then we can't be in state TS_ENTER.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2706361996
More information about the hotspot-runtime-dev
mailing list