Skip to content

Commit

Permalink
Merge pull request #19842 from fengxue-IS/vthread-alive-check
Browse files Browse the repository at this point in the history
Update VThread alive check to check continuation state
  • Loading branch information
babsingh authored Jul 19, 2024
2 parents 881038d + b14cd71 commit 08e67ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion runtime/jvmti/jvmtiHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,14 @@ getVMThread(J9VMThread *currentThread, jthread thread, J9VMThread **vmThreadPtr,
targetThread = carrierVMThread;
}
}
isThreadAlive = (JVMTI_VTHREAD_STATE_NEW != vthreadState) && (JVMTI_VTHREAD_STATE_TERMINATED != vthreadState);
j9object_t continuationObj = J9VMJAVALANGVIRTUALTHREAD_CONT(currentThread, threadObject);
ContinuationState continuationState = *VM_ContinuationHelpers::getContinuationStateAddress(currentThread, continuationObj);
if ((JVMTI_VTHREAD_STATE_NEW != vthreadState)
&& (JVMTI_VTHREAD_STATE_TERMINATED != vthreadState)
&& !VM_ContinuationHelpers::isFinished(continuationState)
) {
isThreadAlive = TRUE;
}
} else
#endif /* JAVA_SPEC_VERSION >= 19 */
{
Expand Down

0 comments on commit 08e67ec

Please sign in to comment.