< prev index next >

src/hotspot/share/prims/jvmtiThreadState.cpp

Print this page
@@ -665,10 +665,16 @@
  JvmtiVTMSTransitionDisabler::VTMS_unmount_end(jobject vthread) {
    JavaThread* thread = JavaThread::current();
    assert(thread->is_in_VTMS_transition(), "sanity check");
    assert(!thread->is_in_tmp_VTMS_transition(), "sanity check");
    finish_VTMS_transition(vthread, /* is_mount */ false);
+ 
+   if (JvmtiExport::should_post_vthread_unmount() && thread->jvmti_unmount_event_pending()) {
+     assert(java_lang_VirtualThread::is_preempted(JNIHandles::resolve(vthread)), "should be marked preempted");
+     JvmtiExport::post_vthread_unmount(vthread);
+     thread->set_jvmti_unmount_event_pending(false);
+   }
  }
  
  
  //
  // Virtual Threads Suspend/Resume management
< prev index next >