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

Anton Artemov aartemov at openjdk.org
Tue Jan 20 09:49:42 UTC 2026


On Tue, 20 Jan 2026 00:12:20 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> 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.

Sorry for missing that. Yes, you are right, it is redundant, as `JvmtiExport::should_post_monitor_waited()` is mutually exclusive with being in the `TS_ENTER` state now. I added this to the comment.

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

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


More information about the hotspot-runtime-dev mailing list