8366659: Changed condition on when to post an event.

This commit is contained in:
Anton Artemov 2026-01-23 09:55:31 +01:00
parent eb5afa252a
commit d01b26a972

View File

@ -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);
}