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

(0.44) Fix virtual thread interrupts #19230

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

babsingh
Copy link
Contributor

babsingh and others added 2 commits March 26, 2024 13:40
In JDK19+, multiple thread objects can be associated to a J9VMThread:
a virtual thread and its carrier thread.

If a virtual thread is mounted, then the carrier thread is unmounted
and vice-versa. In such cases, J9VMThread's state should not be used
to determine if a thread object is interrupted.

Instead, Thread.interrupted is used to determine if a thread object is
interrupted.

If a mounted thread is suspended, only set Thread.interrupted to TRUE
and do not wake/interrupt the thread. This behaviour is expected in
GetThreadStateMountedTest, which is a test added for virtual threads
in JDK22. These changes are only added for virtual threads in JDK19+.

Related: eclipse-openj9#18810

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
@babsingh babsingh requested a review from pshipton March 26, 2024 17:48
@pshipton pshipton merged commit 2e56066 into eclipse-openj9:v0.44.0-release Mar 26, 2024
2 checks passed
@babsingh babsingh changed the title Fix virtual thread interrupts (0.44) Fix virtual thread interrupts Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants