Add jni_libraries_lock_ to expected_mutexes_on_weak_ref_access_.
Fix a DCHECK failure where jni_libraries_lock_ is unexpectedly held
during a weak ref access.
Bug: 35360959
Test: test-art-host
Change-Id: Ief9e97c03cdff7f350e739f1004925a3689ecaf2
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc
index 7bba944..b93b293 100644
--- a/runtime/base/mutex.cc
+++ b/runtime/base/mutex.cc
@@ -1167,6 +1167,8 @@
expected_mutexes_on_weak_ref_access_.push_back(dex_lock_);
classlinker_classes_lock_->SetShouldRespondToEmptyCheckpointRequest(true);
expected_mutexes_on_weak_ref_access_.push_back(classlinker_classes_lock_);
+ jni_libraries_lock_->SetShouldRespondToEmptyCheckpointRequest(true);
+ expected_mutexes_on_weak_ref_access_.push_back(jni_libraries_lock_);
InitConditions();
}