Make thread dumping more tolerant of broken invariants during abort.

Change-Id: Ie1bc20debe72f2ea2bf4c1be50cd9877c823670a
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 @@
 
 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 @@
   // 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 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 @@
           }
         }
       }
-      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 @@
   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);
   }