summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2012-10-12 14:21:10 -0700
committer Ian Rogers <irogers@google.com> 2012-10-15 16:36:07 -0700
commitfbd229147c62d8e8787e27e7c9db3b387ffe39ef (patch)
treef19776e3edde3c635a7343ca942722a87ba46b62
parentc604d731730b43231f63040c8db1d58304da0cf3 (diff)
Attempt to always dump all threads when aborting.
Further pursuit of Bug: 7250540 Change-Id: I99628aa4f5666339b372ab8948d3303ad9687eae
-rw-r--r--src/runtime.cc9
-rw-r--r--src/thread_list.cc1
2 files changed, 6 insertions, 4 deletions
diff --git a/src/runtime.cc b/src/runtime.cc
index ee8a8c8e70..f93d687399 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -188,10 +188,13 @@ struct AbortState {
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 5ef8625a3c..e288878a8e 100644
--- a/src/thread_list.cc
+++ b/src/thread_list.cc
@@ -110,7 +110,6 @@ void ThreadList::DumpUnattachedThreads(std::ostream& os) {
}
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);