From d01b26a97257fe155c05d78371deef055f7b648f Mon Sep 17 00:00:00 2001 From: Anton Artemov Date: Fri, 23 Jan 2026 09:55:31 +0100 Subject: [PATCH] 8366659: Changed condition on when to post an event. --- src/hotspot/share/runtime/objectMonitor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/runtime/objectMonitor.cpp b/src/hotspot/share/runtime/objectMonitor.cpp index b8acf589c5c..360ad73fb53 100644 --- a/src/hotspot/share/runtime/objectMonitor.cpp +++ b/src/hotspot/share/runtime/objectMonitor.cpp @@ -1932,10 +1932,10 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) { // An event could have been enabled after notification, in this case // a thread will have TS_ENTER state and posting the event may hit a suspension point. // From a debugging perspective, it is more important to have no missing events. - if (interruptible && JvmtiExport::should_post_monitor_waited()) { + if (interruptible && JvmtiExport::should_post_monitor_waited() && node.TState != ObjectWaiter::TS_ENTER) { // Process suspend requests now if any, before posting the event. - if (node.TState != ObjectWaiter::TS_ENTER) { + { ThreadBlockInVM tbvm(current, true); }