< prev index next >

src/hotspot/share/oops/instanceKlass.cpp

Print this page
@@ -1103,10 +1103,26 @@
                                 jt->name(), external_name(), init_thread_name());
        }
  
        wait = true;
        jt->set_class_to_be_initialized(this);
+ 
+ #if INCLUDE_JFR
+       ContinuationEntry* ce = jt->last_continuation();
+       if (ce != nullptr && ce->is_virtual_thread()) {
+         EventVirtualThreadPinned e;
+         if (e.should_commit()) {
+           ResourceMark rm(jt);
+           char reason[256];
+           jio_snprintf(reason, sizeof reason, "Waiting for initialization of klass %s", external_name());
+           e.set_pinnedReason(reason);
+           e.set_carrierThread(JFR_JVM_THREAD_ID(THREAD));
+           e.commit();
+         }
+       }
+  #endif
+ 
        ml.wait();
        jt->set_class_to_be_initialized(nullptr);
      }
  
      // Step 3
< prev index next >