Fix a bug when dumping locks from signal catcher
We dump the threads that are holding some important locks in the signal
catcher on a SIGQUIT. The check missed dumping them when a mutator lock
is exlcusively held but other locks aren't.
Test: art/test.py
Change-Id: If87c2d74ba3244d038fbc5e3a88730d36debb1e0
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 6de4dda..401d66c 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -2348,11 +2348,11 @@
}
void Runtime::DumpLockHolders(std::ostream& os) {
- uint64_t mutator_lock_owner = Locks::mutator_lock_->GetExclusiveOwnerTid();
+ pid_t mutator_lock_owner = Locks::mutator_lock_->GetExclusiveOwnerTid();
pid_t thread_list_lock_owner = GetThreadList()->GetLockOwner();
pid_t classes_lock_owner = GetClassLinker()->GetClassesLockOwner();
pid_t dex_lock_owner = GetClassLinker()->GetDexLockOwner();
- if ((thread_list_lock_owner | classes_lock_owner | dex_lock_owner) != 0) {
+ if ((mutator_lock_owner | thread_list_lock_owner | classes_lock_owner | dex_lock_owner) != 0) {
os << "Mutator lock exclusive owner tid: " << mutator_lock_owner << "\n"
<< "ThreadList lock owner tid: " << thread_list_lock_owner << "\n"
<< "ClassLinker classes lock owner tid: " << classes_lock_owner << "\n"