summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-11-04 17:57:02 -0800
committerIan Rogers <irogers@google.com>2014-11-04 17:57:02 -0800
commit8409ec440079020bbe4ad066cf18a5fadfba67d2 (patch)
tree20a5876198e3292b309b00d88345978f1f194a0e
parentb5331ef9bb2ae68c392e5da3da13816bd43e5b1d (diff)
downloadart-8409ec440079020bbe4ad066cf18a5fadfba67d2.zip
art-8409ec440079020bbe4ad066cf18a5fadfba67d2.tar.gz
art-8409ec440079020bbe4ad066cf18a5fadfba67d2.tar.bz2
Make thread dumping more tolerant of broken invariants during abort.
Change-Id: Ie1bc20debe72f2ea2bf4c1be50cd9877c823670a
-rw-r--r--runtime/barrier.cc2
-rw-r--r--runtime/barrier.h2
-rw-r--r--runtime/thread-inl.h8
-rw-r--r--runtime/thread_list.cc2
4 files changed, 9 insertions, 5 deletions
diff --git a/runtime/barrier.cc b/runtime/barrier.cc
index b8edad3..5a8fbb3 100644
--- a/runtime/barrier.cc
+++ b/runtime/barrier.cc
@@ -23,7 +23,7 @@ namespace art {
Barrier::Barrier(int count)
: count_(count),
- lock_("GC barrier lock"),
+ lock_("GC barrier lock", kThreadSuspendCountLock),
condition_("GC barrier condition", lock_) {
}
diff --git a/runtime/barrier.h b/runtime/barrier.h
index 167e1d6..5ca88e8 100644
--- a/runtime/barrier.h
+++ b/runtime/barrier.h
@@ -50,7 +50,7 @@ class Barrier {
// Counter, when this reaches 0 all people blocked on the barrier are signalled.
int count_ GUARDED_BY(lock_);
- Mutex lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
+ Mutex lock_ ACQUIRED_AFTER(Locks::abort_lock_);
ConditionVariable condition_ GUARDED_BY(lock_);
};
diff --git a/runtime/thread-inl.h b/runtime/thread-inl.h
index e1b5b91..94f7585 100644
--- a/runtime/thread-inl.h
+++ b/runtime/thread-inl.h
@@ -78,7 +78,9 @@ inline ThreadState Thread::SetState(ThreadState new_state) {
inline void Thread::AssertThreadSuspensionIsAllowable(bool check_locks) const {
if (kIsDebugBuild) {
- CHECK_EQ(0u, tls32_.no_thread_suspension) << tlsPtr_.last_no_thread_suspension_cause;
+ if (gAborting == 0) {
+ CHECK_EQ(0u, tls32_.no_thread_suspension) << tlsPtr_.last_no_thread_suspension_cause;
+ }
if (check_locks) {
bool bad_mutexes_held = false;
for (int i = kLockLevelCount - 1; i >= 0; --i) {
@@ -92,7 +94,9 @@ inline void Thread::AssertThreadSuspensionIsAllowable(bool check_locks) const {
}
}
}
- CHECK(!bad_mutexes_held);
+ if (gAborting == 0) {
+ CHECK(!bad_mutexes_held);
+ }
}
}
}
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index e3ef4eb..48f283d 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -241,7 +241,7 @@ size_t ThreadList::RunCheckpoint(Closure* checkpoint_function) {
Locks::mutator_lock_->AssertNotExclusiveHeld(self);
Locks::thread_list_lock_->AssertNotHeld(self);
Locks::thread_suspend_count_lock_->AssertNotHeld(self);
- if (kDebugLocking) {
+ if (kDebugLocking && gAborting == 0) {
CHECK_NE(self->GetState(), kRunnable);
}