Attempt to always dump all threads when aborting.
Further pursuit of Bug: 7250540
Change-Id: I99628aa4f5666339b372ab8948d3303ad9687eae
diff --git a/src/runtime.cc b/src/runtime.cc
index ee8a8c8..f93d687 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -188,10 +188,13 @@
void DumpAllThreads(std::ostream& os, Thread* self) NO_THREAD_SAFETY_ANALYSIS {
bool tll_already_held = Locks::thread_list_lock_->IsExclusiveHeld(self);
bool ml_already_held = Locks::mutator_lock_->IsSharedHeld(self);
- if (tll_already_held && ml_already_held) {
- os << "All threads:\n";
- Runtime::Current()->GetThreadList()->DumpLocked(os);
+ if (!tll_already_held || !ml_already_held) {
+ os << "Dumping all threads without appropriate locks held:"
+ << (!tll_already_held ? " thread list lock" : "")
+ << (!ml_already_held ? " mutator lock" : "");
}
+ os << "All threads:\n";
+ Runtime::Current()->GetThreadList()->DumpLocked(os);
}
};