8325186: JVMTI VirtualThreadGetThreadStateClosure class is no longer used and should be removed
Reviewed-by: lmesnik, sspitsyn
This commit is contained in:
parent
5f7432f7b1
commit
5d19d15517
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user