Navigation Menu

Skip to content

Commit

Permalink
8290908: misc tests fail: assert(!thread->owns_locks()) failed: must …
Browse files Browse the repository at this point in the history
…release all locks when leaving VM

Backport-of: 0ae834105740f7cf73fe96be22e0f564ad29b18d
  • Loading branch information
adinn committed Oct 28, 2022
1 parent b2061e0 commit 26351bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hotspot/share/prims/jvmtiEventController.cpp
Expand Up @@ -830,10 +830,6 @@ JvmtiEventControllerPrivate::set_user_enabled(JvmtiEnvBase *env, JavaThread *thr
thread==NULL? "ALL": JvmtiTrace::safe_get_thread_name(thread),
enabled? "enabled" : "disabled", JvmtiTrace::event_name(event_type)));

if (event_type == JVMTI_EVENT_OBJECT_FREE) {
flush_object_free_events(env);
}

if (thread == NULL) {
env->env_event_enable()->set_user_enabled(event_type, enabled);
} else {
Expand Down Expand Up @@ -982,6 +978,10 @@ JvmtiEventController::is_global_event(jvmtiEvent event_type) {

void
JvmtiEventController::set_user_enabled(JvmtiEnvBase *env, JavaThread *thread, jvmtiEvent event_type, bool enabled) {
if (event_type == JVMTI_EVENT_OBJECT_FREE) {
JvmtiEventControllerPrivate::flush_object_free_events(env);
}

if (Threads::number_of_threads() == 0) {
// during early VM start-up locks don't exist, but we are safely single threaded,
// call the functionality without holding the JvmtiThreadState_lock.
Expand Down

1 comment on commit 26351bf

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.