Skip to content

Commit b4f2424

Browse files
authored
Merge pull request #19901 from fengxue-IS/v047-19842
(0.47) Update VThread alive check to check continuation state
2 parents 05ef087 + f96c6e0 commit b4f2424

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

runtime/jvmti/jvmtiHelpers.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,14 @@ getVMThread(J9VMThread *currentThread, jthread thread, J9VMThread **vmThreadPtr,
179179
targetThread = carrierVMThread;
180180
}
181181
}
182-
isThreadAlive = (JVMTI_VTHREAD_STATE_NEW != vthreadState) && (JVMTI_VTHREAD_STATE_TERMINATED != vthreadState);
182+
j9object_t continuationObj = J9VMJAVALANGVIRTUALTHREAD_CONT(currentThread, threadObject);
183+
ContinuationState continuationState = *VM_ContinuationHelpers::getContinuationStateAddress(currentThread, continuationObj);
184+
if ((JVMTI_VTHREAD_STATE_NEW != vthreadState)
185+
&& (JVMTI_VTHREAD_STATE_TERMINATED != vthreadState)
186+
&& !VM_ContinuationHelpers::isFinished(continuationState)
187+
) {
188+
isThreadAlive = TRUE;
189+
}
183190
} else
184191
#endif /* JAVA_SPEC_VERSION >= 19 */
185192
{

0 commit comments

Comments
 (0)