Skip to content

Commit

Permalink
Merge pull request #19186 from fengxue-IS/patch-18504
Browse files Browse the repository at this point in the history
Update thread interrupt helpers to adopt internalSuspendState
  • Loading branch information
babsingh authored Mar 20, 2024
2 parents 7c9937b + 23d39bc commit 875d19e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions runtime/oti/VMHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1412,9 +1412,9 @@ class VM_VMHelpers
bool result = false;
#if JAVA_SPEC_VERSION >= 19
/* Check if the mounted thread is suspended. */
U_32 isSuspended = 0;
bool isSuspended = false;
if (NULL != targetThread) {
isSuspended = J9OBJECT_U32_LOAD(currentThread, targetThread->threadObject, currentThread->javaVM->internalSuspendStateOffset);
isSuspended = isThreadSuspended(currentThread, targetThread->threadObject);
}
#endif /* JAVA_SPEC_VERSION >= 19 */
/* If the thread is alive, ask the OS thread. Otherwise, answer false. */
Expand All @@ -1425,7 +1425,7 @@ class VM_VMHelpers
* In JDK19+, OJDK's Thread implementation is used. If the mounted thread is
* suspended, use Thread.interrupted to derive if the thread is interrupted.
*/
&& (0 == isSuspended)
&& (!isSuspended)
#endif /* JAVA_SPEC_VERSION >= 19 */
) {
if (omrthread_interrupted(targetThread->osThread)) {
Expand Down Expand Up @@ -2062,9 +2062,9 @@ class VM_VMHelpers
J9JavaVM *vm = currentThread->javaVM;
#if JAVA_SPEC_VERSION >= 19
/* Check if the mounted thread is suspended. */
U_32 isSuspended = 0;
bool isSuspended = false;
if (NULL != targetThread) {
isSuspended = J9OBJECT_U32_LOAD(currentThread, targetThread->threadObject, vm->internalSuspendStateOffset);
isSuspended = isThreadSuspended(currentThread, targetThread->threadObject);
}
#endif /* JAVA_SPEC_VERSION >= 19 */
if ((NULL != targetThread)
Expand All @@ -2075,7 +2075,7 @@ class VM_VMHelpers
* suspended, only set Thread.interrupted to TRUE and do not wake/interrupt
* the thread.
*/
&& (0 == isSuspended)
&& (!isSuspended)
#endif /* JAVA_SPEC_VERSION >= 19 */
) {
void (*sidecarInterruptFunction)(J9VMThread*) = vm->sidecarInterruptFunction;
Expand Down

0 comments on commit 875d19e

Please sign in to comment.