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.37) Pass valid JNI refs to getVirtualThreadState #16878

Merged

Conversation

babsingh
Copy link
Contributor

@babsingh babsingh commented Mar 10, 2023

(jthread)&threadObject is not a JNI ref, and it will not be
updated by the GC when VM access is released in
jvmtiHelpers.c::getVirtualThreadState.

Non-null thread refs are directly passed to getVirtualThreadState.
A local ref is created for currentThread->threadObject before it is
passed to getVirtualThreadState. This assures that the GC updates
the virtual thread object which is passed to getVirtualThreadState.

In getVirtualThreadState, the virtual thread object is refected
after VM access is re-acquired to prevent access to a stale object.

Backport of #16877

(jthread)&threadObject is not a JNI ref, and it will not be
updated by the GC when VM access is released in
jvmtiHelpers.c::getVirtualThreadState.

Non-null thread refs are directly passed to getVirtualThreadState.
A local ref is created for currentThread->threadObject before it is
passed to getVirtualThreadState. This assures that the GC updates
the virtual thread object which is passed to getVirtualThreadState.

In getVirtualThreadState, the virtual thread object is refected
after VM access is re-acquired to prevent access to a stale object.

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
@gacholio gacholio merged commit 095fe80 into eclipse-openj9:v0.37.0-release Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants