On Mon, 19 Jan 2026 11:14:41 GMT, Anton Artemov <[email protected]> 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

Reply via email to