diff options
author | Ian Rogers <irogers@google.com> | 2014-11-04 17:57:02 -0800 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-11-04 17:57:02 -0800 |
commit | 8409ec440079020bbe4ad066cf18a5fadfba67d2 (patch) | |
tree | 20a5876198e3292b309b00d88345978f1f194a0e | |
parent | b5331ef9bb2ae68c392e5da3da13816bd43e5b1d (diff) | |
download | art-8409ec440079020bbe4ad066cf18a5fadfba67d2.tar.gz art-8409ec440079020bbe4ad066cf18a5fadfba67d2.tar.bz2 art-8409ec440079020bbe4ad066cf18a5fadfba67d2.zip |
Make thread dumping more tolerant of broken invariants during abort.
Change-Id: Ie1bc20debe72f2ea2bf4c1be50cd9877c823670a
-rw-r--r-- | runtime/barrier.cc | 2 | ||||
-rw-r--r-- | runtime/barrier.h | 2 | ||||
-rw-r--r-- | runtime/thread-inl.h | 8 | ||||
-rw-r--r-- | runtime/thread_list.cc | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/runtime/barrier.cc b/runtime/barrier.cc index b8edad32af..5a8fbb363c 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 167e1d6bd9..5ca88e863c 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 e1b5b91c31..94f7585bea 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 e3ef4eb26e..48f283d101 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); } |