Rename GlobalSynchronization to Locks

Also address some review comments in common_throws relating to
ToStr<InvokeType> and exception detail messages.

Change-Id: Ibf2c0f147689fa236d349bd7f01eed3c2522552b
diff --git a/src/monitor.h b/src/monitor.h
index b506b39..de70803 100644
--- a/src/monitor.h
+++ b/src/monitor.h
@@ -73,43 +73,43 @@
 
   static void MonitorEnter(Thread* thread, Object* obj)
       EXCLUSIVE_LOCK_FUNCTION(monitor_lock_)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
   static bool MonitorExit(Thread* thread, Object* obj)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_)
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
       UNLOCK_FUNCTION(monitor_lock_);
 
   static void Notify(Thread* self, Object* obj)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
   static void NotifyAll(Thread* self, Object* obj)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
   static void Wait(Thread* self, Object* obj, int64_t ms, int32_t ns, bool interruptShouldThrow)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   static void DescribeWait(std::ostream& os, const Thread* thread)
-      LOCKS_EXCLUDED(GlobalSynchronization::thread_suspend_count_lock_)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      LOCKS_EXCLUDED(Locks::thread_suspend_count_lock_)
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
   static void DescribeLocks(std::ostream& os, StackVisitor* stack_visitor)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   Object* GetObject();
 
  private:
   explicit Monitor(Thread* owner, Object* obj)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   void AppendToWaitSet(Thread* thread) EXCLUSIVE_LOCKS_REQUIRED(monitor_lock_);
   void RemoveFromWaitSet(Thread* thread) EXCLUSIVE_LOCKS_REQUIRED(monitor_lock_);
 
   static void Inflate(Thread* self, Object* obj)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   void LogContentionEvent(Thread* self, uint32_t wait_ms, uint32_t sample_percent,
                           const char* owner_filename, uint32_t owner_line_number)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   static void FailedUnlock(Object* obj, Thread* expected_owner, Thread* found_owner, Monitor* mon)
-      LOCKS_EXCLUDED(GlobalSynchronization::thread_list_lock_)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      LOCKS_EXCLUDED(Locks::thread_list_lock_)
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   void Lock(Thread* self) EXCLUSIVE_LOCK_FUNCTION(monitor_lock_);
   bool Unlock(Thread* thread, bool for_wait) UNLOCK_FUNCTION(monitor_lock_);
@@ -117,24 +117,24 @@
   void Notify(Thread* self) NO_THREAD_SAFETY_ANALYSIS;
   void NotifyWithLock()
       EXCLUSIVE_LOCKS_REQUIRED(monitor_lock_)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   void NotifyAll(Thread* self) NO_THREAD_SAFETY_ANALYSIS;
   void NotifyAllWithLock()
       EXCLUSIVE_LOCKS_REQUIRED(monitor_lock_)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
 
   void Wait(Thread* self, int64_t msec, int32_t nsec, bool interruptShouldThrow)
       NO_THREAD_SAFETY_ANALYSIS;
   void WaitWithLock(Thread* self, int64_t ms, int32_t ns, bool interruptShouldThrow)
       EXCLUSIVE_LOCKS_REQUIRED(monitor_lock_)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   // Translates the provided method and pc into its declaring class' source file and line number.
   void TranslateLocation(const Method* method, uint32_t pc,
                          const char*& source_file, uint32_t& line_number) const
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   static bool (*is_sensitive_thread_hook_)();
   static uint32_t lock_profiling_threshold_;
@@ -172,7 +172,7 @@
   void Add(Monitor* m);
 
   void SweepMonitorList(Heap::IsMarkedTester is_marked, void* arg)
-      SHARED_LOCKS_REQUIRED(GlobalSynchronization::heap_bitmap_lock_);
+      SHARED_LOCKS_REQUIRED(Locks::heap_bitmap_lock_);
 
  private:
   Mutex monitor_list_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;