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

Loom: VirtualThread support for JVMTI GetThreadState #15762

Closed
fengxue-IS opened this issue Aug 21, 2022 · 1 comment · Fixed by #15811
Closed

Loom: VirtualThread support for JVMTI GetThreadState #15762

fengxue-IS opened this issue Aug 21, 2022 · 1 comment · Fixed by #15811
Assignees
Labels
comp:vm project:loom Used to track Project Loom related work
Milestone

Comments

@fengxue-IS
Copy link
Contributor

Part of #15183
https://download.java.net/java/early_access/jdk19/docs/specs/jvmti.html#GetThreadState

Need to check if thread object is VirtualThread, return the correct state based on VirtualThread.state

See: #15183 (comment)

@fengxue-IS fengxue-IS added comp:vm project:loom Used to track Project Loom related work labels Aug 21, 2022
@tajila tajila added this to the Java 19 milestone Aug 23, 2022
@hangshao0
Copy link
Contributor

I can look at this one.

hangshao0 added a commit to hangshao0/openj9 that referenced this issue Sep 13, 2022
1. If jvmtiGetThreadState() is called on a virtual thread, retrieve
java.lang.VirtualThread.State and map it to
JVMTI_JAVA_LANG_THREAD_STATE_XXX.

2. Fix assertion failure.

Closes eclipse-openj9#15762

Signed-off-by: Hang Shao <hangshao@ca.ibm.com>
babsingh added a commit to babsingh/openj9 that referenced this issue Sep 26, 2022
A mounted virtual thread is associated to a valid J9VMThread.

For virtual threads, targetThread is non-null for PARKING and YIELDING
states. getVirtualThreadState has been updated to use carrier thread's
state whenever targetThread is non-null for a virtual thread. This
correctly returns the JVMTI_THREAD_STATE_SUSPENDED flag for virtual
threads.

Related: eclipse-openj9#15762

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
babsingh added a commit to babsingh/openj9 that referenced this issue Sep 27, 2022
A mounted virtual thread is associated to a valid J9VMThread.

For virtual threads, targetThread is non-null for PARKING and YIELDING
states. getVirtualThreadState has been updated to use carrier thread's
state whenever targetThread is non-null for a virtual thread. This
correctly returns the JVMTI_THREAD_STATE_SUSPENDED flag for virtual
threads.

Related: eclipse-openj9#15762

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm project:loom Used to track Project Loom related work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants