diff --git a/src/hotspot/share/prims/jvmtiEnvBase.cpp b/src/hotspot/share/prims/jvmtiEnvBase.cpp index e06b118d2f3..cf7f1743f8d 100644 --- a/src/hotspot/share/prims/jvmtiEnvBase.cpp +++ b/src/hotspot/share/prims/jvmtiEnvBase.cpp @@ -2619,26 +2619,3 @@ VirtualThreadGetThreadClosure::do_thread(Thread *target) { oop carrier_thread = java_lang_VirtualThread::carrier_thread(_vthread_h()); *_carrier_thread_ptr = (jthread)JNIHandles::make_local(jt, carrier_thread); } - -void -VirtualThreadGetThreadStateClosure::do_thread(Thread *target) { - assert(target->is_Java_thread(), "just checking"); - int vthread_state = java_lang_VirtualThread::state(_vthread_h()); - oop carrier_thread_oop = java_lang_VirtualThread::carrier_thread(_vthread_h()); - jint state; - - if (vthread_state == java_lang_VirtualThread::RUNNING && carrier_thread_oop != nullptr) { - state = (jint) java_lang_Thread::get_thread_status(carrier_thread_oop); - JavaThread* java_thread = java_lang_Thread::thread(carrier_thread_oop); - if (java_thread->is_suspended()) { - state |= JVMTI_THREAD_STATE_SUSPENDED; - } - } else { - state = (jint) java_lang_VirtualThread::map_state_to_thread_status(vthread_state); - } - if (java_lang_Thread::interrupted(_vthread_h())) { - state |= JVMTI_THREAD_STATE_INTERRUPTED; - } - *_state_ptr = state; - _result = JVMTI_ERROR_NONE; -} diff --git a/src/hotspot/share/prims/jvmtiEnvBase.hpp b/src/hotspot/share/prims/jvmtiEnvBase.hpp index 25e7d5c371b..637b0e70796 100644 --- a/src/hotspot/share/prims/jvmtiEnvBase.hpp +++ b/src/hotspot/share/prims/jvmtiEnvBase.hpp @@ -796,25 +796,6 @@ public: jvmtiError result() { return _result; } }; -// HandshakeClosure to get virtual thread state at safepoint. -class VirtualThreadGetThreadStateClosure : public HandshakeClosure { -private: - Handle _vthread_h; - jint *_state_ptr; - jvmtiError _result; - -public: - VirtualThreadGetThreadStateClosure(Handle vthread_h, jint *state_ptr) - : HandshakeClosure("VirtualThreadGetThreadState"), - _vthread_h(vthread_h), - _state_ptr(state_ptr), - _result(JVMTI_ERROR_NONE) {} - - void do_thread(Thread *target); - jvmtiError result() { return _result; } -}; - - // ResourceTracker // // ResourceTracker works a little like a ResourceMark. All allocates