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

8307156: native_thread not protected by TLH #13780

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/hotspot/share/jfr/jni/jfrJavaSupport.cpp
Expand Up @@ -664,8 +664,7 @@ bool JfrJavaSupport::is_jdk_jfr_module_available(outputStream* stream, TRAPS) {

typedef JfrOopTraceId<ThreadIdAccess> AccessThreadTraceId;

static JavaThread* get_native(jobject thread) {
ThreadsListHandle tlh;
static JavaThread* get_native(ThreadsListHandle& tlh, jobject thread) {
JavaThread* native_thread = NULL;
(void)tlh.cv_internal_thread_to_JavaThread(thread, &native_thread, NULL);
return native_thread;
Expand Down Expand Up @@ -704,7 +703,8 @@ void JfrJavaSupport::exclude(JavaThread* jt, oop ref, jobject thread) {
return;
}
}
jt = get_native(thread);
ThreadsListHandle tlh;
jt = get_native(tlh, thread);
if (jt != nullptr) {
JfrThreadLocal::exclude_jvm_thread(jt);
}
Expand All @@ -720,7 +720,8 @@ void JfrJavaSupport::include(JavaThread* jt, oop ref, jobject thread) {
return;
}
}
jt = get_native(thread);
ThreadsListHandle tlh;
jt = get_native(tlh, thread);
if (jt != nullptr) {
JfrThreadLocal::include_jvm_thread(jt);
}
Expand Down