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

Anton Artemov aartemov at openjdk.org
Wed Jan 21 13:26:40 UTC 2026


On Wed, 21 Jan 2026 04:46:56 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> I think Dan is right that this has changed the behaviour by deciding `was_notified` earlier in the process. Now this check:
>> 
>> 1882       if (interrupted || HAS_PENDING_EXCEPTION) {
>> 1883         was_notified = false;
>> 
>> will supercede the fact we could actually have been notified. And that is a problem because if the current was notified but now throws InterruptedException then we lose the notification.  I think my suggestion to set `was_notified` at 1883 was wrong - we need to  undo that. 
>> 
>> The key point is that if we unlink ourselves then we were definitely not notified; otherwise we must have been.
>
> Might be clearer to move `bool was_notified = true;` right before the branch at L1908 where we determine if there was a notification or not.

I think we just undo this recent change, moving `bool was_notified = true;`  to L1908 is not possible as it is used further at L2012 outside of this huge code block. So it has to be declared where it used to be.

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

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


More information about the hotspot-runtime-dev mailing list