Skip to content
Permalink
Browse files

fix JVMTI GetThreadState to check one bit vs whole status word

  • Loading branch information
sspitsyn committed Feb 20, 2020
1 parent 127011e commit 1a1449e840fc579fc47c8ee865f40b65ba508203
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/hotspot/share/prims/jvmtiEnv.cpp
  2. +1 −1 src/hotspot/share/prims/jvmtiEnvBase.cpp
@@ -925,7 +925,7 @@ JvmtiEnv::GetThreadState(jthread thread, jint* thread_state_ptr) {
}
jshort vthread_state = java_lang_VirtualThread::state(thread_oop);

if (vthread_state != java_lang_VirtualThread::RUNNING) {
if (!(vthread_state & java_lang_VirtualThread::RUNNING)) {
jint state = (jint) java_lang_VirtualThread::map_state_to_thread_status(vthread_state);
if (java_lang_Thread::interrupted(thread_oop)) {
state |= JVMTI_THREAD_STATE_INTERRUPTED;
@@ -1809,7 +1809,7 @@ VM_VirtualThreadGetThreadState::doit() {
oop carrier_thread_oop = java_lang_VirtualThread::carrier_thread(_vthread_h());
jint state;

if (vthread_state == java_lang_VirtualThread::RUNNING && carrier_thread_oop != NULL) {
if ((vthread_state & java_lang_VirtualThread::RUNNING) && carrier_thread_oop != NULL) {
state = java_lang_Thread::get_thread_status(carrier_thread_oop);
} else {
state = (jint) java_lang_VirtualThread::map_state_to_thread_status(vthread_state);

0 comments on commit 1a1449e

Please sign in to comment.
You can’t perform that action at this time.