Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update thread interrupt helpers to adopt internalSuspendState #19186

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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