Remove Mutex from NativeProcessLinux

NPL now assumes it is running from a single thread now, so its thread-safety is untested
anyway (and if that assumption is broken, we'll have bigger problems (due to ptrace restrictions)
than a couple of missing mutexes).

llvm-svn: 269640
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 15498ea..feab1ad 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -427,7 +427,6 @@
     m_arch (),
     m_supports_mem_region (eLazyBoolCalculate),
     m_mem_region_cache (),
-    m_mem_region_cache_mutex(),
     m_pending_notification_tid(LLDB_INVALID_THREAD_ID)
 {
 }
@@ -1149,8 +1148,6 @@
 
     assert(info.si_signo == SIGTRAP && "Unexpected child signal!");
 
-    Mutex::Locker locker (m_threads_mutex);
-
     switch (info.si_code)
     {
     // TODO: these two cases are required if we want to support tracing of the inferiors' children.  We'd need this to debug a monitor.
@@ -1186,7 +1183,7 @@
         // Exec clears any pending notifications.
         m_pending_notification_tid = LLDB_INVALID_THREAD_ID;
 
-        // Remove all but the main thread here.  Linux fork creates a new process which only copies the main thread.  Mutexes are in undefined state.
+        // Remove all but the main thread here.  Linux fork creates a new process which only copies the main thread.
         if (log)
             log->Printf ("NativeProcessLinux::%s exec received, stop tracking all but main thread", __FUNCTION__);
 
@@ -1412,8 +1409,6 @@
     //
     // Similarly, ACK signals generated by this monitor.
 
-    Mutex::Locker locker (m_threads_mutex);
-
     // Handle the signal.
     if (info.si_code == SI_TKILL || info.si_code == SI_USER)
     {
@@ -1712,8 +1707,6 @@
 
     bool software_single_step = !SupportHardwareSingleStepping();
 
-    Mutex::Locker locker (m_threads_mutex);
-
     if (software_single_step)
     {
         for (auto thread_sp : m_threads)
@@ -1839,8 +1832,6 @@
     if (log)
         log->Printf ("NativeProcessLinux::%s selecting running thread for interrupt target", __FUNCTION__);
 
-    Mutex::Locker locker (m_threads_mutex);
-
     for (auto thread_sp : m_threads)
     {
         // The thread shouldn't be null but lets just cover that here.
@@ -2001,7 +1992,6 @@
     // Use an approach that reads memory regions from /proc/{pid}/maps.
     // Assume proc maps entries are in ascending order.
     // FIXME assert if we find differently.
-    Mutex::Locker locker (m_mem_region_cache_mutex);
 
     Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     Error error;
@@ -2126,12 +2116,9 @@
     if (log)
         log->Printf ("NativeProcessLinux::%s(newBumpId=%" PRIu32 ") called", __FUNCTION__, newBumpId);
 
-    {
-        Mutex::Locker locker (m_mem_region_cache_mutex);
         if (log)
             log->Printf ("NativeProcessLinux::%s clearing %" PRIu64 " entries from the cache", __FUNCTION__, static_cast<uint64_t> (m_mem_region_cache.size ()));
         m_mem_region_cache.clear ();
-    }
 }
 
 Error
@@ -2230,7 +2217,6 @@
     // with respect to thread state and they keep the thread list
     // populated properly. All this method needs to do is return the
     // thread count.
-    Mutex::Locker locker (m_threads_mutex);
     return m_threads.size ();
 }
 
@@ -2727,7 +2713,6 @@
 
     bool found = false;
 
-    Mutex::Locker locker (m_threads_mutex);
     for (auto it = m_threads.begin (); it != m_threads.end (); ++it)
     {
         if (*it && ((*it)->GetID () == thread_id))
@@ -2748,8 +2733,6 @@
 {
     Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
 
-    Mutex::Locker locker (m_threads_mutex);
-
     if (log)
     {
         log->Printf ("NativeProcessLinux::%s pid %" PRIu64 " adding thread with tid %" PRIu64,