RFR: 8366659: ObjectMonitor::wait() liveness problem with a suspension request [v27]

Patricio Chilano Mateo pchilanomate at openjdk.org
Thu Jan 22 03:38:40 UTC 2026


On Thu, 22 Jan 2026 02:37:41 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/runtime/objectMonitor.cpp line 1907:
>> 
>>> 1905:     // then we'll acquire the lock and then re-fetch a fresh TState value.
>>> 1906:     // That is, we fail toward safety.
>>> 1907:     was_notified = true;
>> 
>> You can't just go back to this as it is wrong. Your are now marking an initial interrupt case as "was_notified"
>
> This should be:
> 
> was_notified = node.TState == ObjectWaiter::TS_RUN || node.TState == ObjectWaiter::TS_ENTER;
> 
> and no need to adjust to false below (as it will already be false).

Note that if the thread was interrupted the state will be `TS_WAIT` here, so `was_notified ` will be set to false. If the thread was interrupted and notified we consider it a notification case (even if the unpark was due to the interrupt).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27040#discussion_r2715178509


More information about the hotspot-runtime-dev mailing list