From a8f662ecb2cf13ba7fa499b9a9150da4318306a8 Mon Sep 17 00:00:00 2001 From: Patricio Chilano Mateo Date: Mon, 13 Mar 2023 20:15:23 +0000 Subject: [PATCH] 8303908: Add missing check in VTMS_transition_disable_for_all() for suspend mode Reviewed-by: sspitsyn, dholmes --- src/hotspot/share/prims/jvmtiThreadState.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/prims/jvmtiThreadState.cpp b/src/hotspot/share/prims/jvmtiThreadState.cpp index 133dd784c4a..0d1646d0569 100644 --- a/src/hotspot/share/prims/jvmtiThreadState.cpp +++ b/src/hotspot/share/prims/jvmtiThreadState.cpp @@ -328,7 +328,8 @@ JvmtiVTMSTransitionDisabler::VTMS_transition_disable_for_all() { } if (_is_SR) { _SR_mode = true; - while (_VTMS_transition_disable_for_all_count > 0) { + while (_VTMS_transition_disable_for_all_count > 0 || + _VTMS_transition_disable_for_one_count > 0) { ml.wait(10); // Wait while there is any active jvmtiVTMSTransitionDisabler. } } @@ -369,7 +370,7 @@ JvmtiVTMSTransitionDisabler::VTMS_transition_enable_for_one() { MonitorLocker ml(JvmtiVTMSTransition_lock); java_lang_Thread::dec_VTMS_transition_disable_count(vth()); Atomic::dec(&_VTMS_transition_disable_for_one_count); - if (_VTMS_transition_disable_for_one_count == 0 || _is_SR) { + if (_VTMS_transition_disable_for_one_count == 0) { ml.notify_all(); } #ifdef ASSERT