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

Reviewed-by: cjplummer, amenkov
  • Loading branch information
Serguei Spitsyn committed Aug 2, 2022
1 parent 5acf2d7 commit 0ae8341
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hotspot/share/prims/jvmtiEventController.cpp
Expand Up @@ -892,10 +892,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 && thread_oop_h() == NULL) {
// NULL thread and NULL thread_oop now indicate setting globally instead
// of setting thread specific since NULL thread by itself means an
Expand Down Expand Up @@ -1048,6 +1044,10 @@ JvmtiEventController::is_global_event(jvmtiEvent event_type) {
void
JvmtiEventController::set_user_enabled(JvmtiEnvBase *env, JavaThread *thread, oop thread_oop,
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 0ae8341

@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.