RFR: 8369944: Notification can be lost due to interrupt in Object.wait [v2]

Patricio Chilano Mateo pchilanomate at openjdk.org
Fri Oct 17 15:47:26 UTC 2025


On Fri, 17 Oct 2025 02:42:29 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   rename to was_notified
>
> src/hotspot/share/runtime/objectMonitor.hpp line 70:
> 
>> 68:   bool is_wait()            const { return _is_wait; }
>> 69:   bool at_reenter()         const { return _at_reenter; }
>> 70:   bool at_monitorenter()    const { return !_is_wait || TState != TS_WAIT; }
> 
> Why did we drop the check of `_at_reenter` here?

It was redundant. If `_at_reenter` is true then it implies we are not in `TS_WAIT` anymore. We only need it for the virtual thread case to know if we need to call `vthread_wait_reenter()` when resuming the monitor operation (needs to be called always after the wait part is done).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27856#discussion_r2440432153


More information about the hotspot-runtime-dev mailing list