Merge "Attempt to always dump all threads when aborting." into dalvik-dev
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);
}
};
diff --git a/src/thread_list.cc b/src/thread_list.cc
index 5ef8625..e288878 100644
--- a/src/thread_list.cc
+++ b/src/thread_list.cc
@@ -110,7 +110,6 @@
}
void ThreadList::DumpLocked(std::ostream& os) {
- Locks::thread_list_lock_->AssertHeld(Thread::Current());
os << "DALVIK THREADS (" << list_.size() << "):\n";
for (It it = list_.begin(), end = list_.end(); it != end; ++it) {
(*it)->Dump(os);