Fail threads attaching during runtime shutdown.

Introduce counters to indicate that threads are being born. Don't allow
thread birth to occur during runtime shutdown.

Bug: 7000936

Change-Id: Ib0d78f78c0ff126a4b5d3b5a6f1a2ff8f5061ae9
diff --git a/src/thread_list.h b/src/thread_list.h
index f1c8a44..b5546e3 100644
--- a/src/thread_list.h
+++ b/src/thread_list.h
@@ -74,11 +74,9 @@
 
   // Add/remove current thread from list.
   void Register(Thread* self)
-      LOCKS_EXCLUDED(Locks::mutator_lock_,
-                     Locks::thread_list_lock_);
-  void Unregister(Thread* self)
-      LOCKS_EXCLUDED(Locks::mutator_lock_,
-                     Locks::thread_list_lock_);
+      EXCLUSIVE_LOCKS_REQUIRED(Locks::runtime_shutdown_lock_)
+      LOCKS_EXCLUDED(Locks::mutator_lock_, Locks::thread_list_lock_);
+  void Unregister(Thread* self) LOCKS_EXCLUDED(Locks::mutator_lock_, Locks::thread_list_lock_);
 
   void VisitRoots(Heap::RootVisitor* visitor, void* arg) const
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);