On Wed, 21 Jan 2026 21:33:30 GMT, Leonid Mesnik <[email protected]> wrote:

>> Serguei Spitsyn has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   review: restored the original assert with a different message
>
> src/hotspot/share/runtime/handshake.cpp line 525:
> 
>> 523: #if INCLUDE_JVMTI
>> 524:   if (allow_suspend && (_handshakee->is_disable_suspend() || 
>> _handshakee->is_vthread_transition_disabler())) {
>> 525:     // filter out suspend operations while JavaThread is in 
>> disable_suspend mode
> 
> does it makes sense to update comment to   
>  // filter out suspend operations while JavaThread is in disable_suspend mode 
> or in transition
> or  something more generic
>  // check if JavaThread can be suspended in this handshake

Thanks. How about more generic? :

@@ -522,7 +522,7 @@ HandshakeOperation* HandshakeState::get_op_for_self(bool 
allow_suspend, bool che
   assert(allow_suspend || !check_async_exception, "invalid case");
 #if INCLUDE_JVMTI
   if (allow_suspend && (_handshakee->is_disable_suspend() || 
_handshakee->is_vthread_transition_disabler())) {
-    // filter out suspend operations while JavaThread is in disable_suspend 
mode
+    // filter out suspend operations while JavaThread can not be suspended
     allow_suspend = false;
   }
 #endif

> test/hotspot/jtreg/serviceability/jvmti/vthread/ThreadStateTest2/libThreadStateTest2.cpp
>  line 63:
> 
>> 61: JNIEXPORT void JNICALL
>> 62: Java_ThreadStateTest2_setMonitorContendedMode(JNIEnv* jni, jclass klass, 
>> jboolean enable) {
>> 63:   jvmtiError err = jvmti->SetEventNotificationMode(enable ? JVMTI_ENABLE 
>> : JVMTI_DISABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTER, nullptr);
> 
> You can use
> set_event_notification_mode(jvmtiEnv*, ... )
> from jvmti_common.h

Thanks, fixed now.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28740#discussion_r2714723247
PR Review Comment: https://git.openjdk.org/jdk/pull/28740#discussion_r2714723634

Reply via email to