From bb19a13c0b3fe1ecdc1e46bbf2b06ffc1e25e04e Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 19 May 2016 05:13:57 +0000 Subject: second pass over removal of Mutex and Condition llvm-svn: 270024 --- .../Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index a7a335d993e..53bf9f653ab 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1646,7 +1646,7 @@ ProcessGDBRemote::HandleStopReplySequence () void ProcessGDBRemote::ClearThreadIDList () { - Mutex::Locker locker(m_thread_list_real.GetMutex()); + std::lock_guard guard(m_thread_list_real.GetMutex()); m_thread_ids.clear(); m_thread_pcs.clear(); } @@ -1696,7 +1696,7 @@ ProcessGDBRemote::UpdateThreadPCsFromStopReplyThreadsValue (std::string &value) bool ProcessGDBRemote::UpdateThreadIDList () { - Mutex::Locker locker(m_thread_list_real.GetMutex()); + std::lock_guard guard(m_thread_list_real.GetMutex()); if (m_jthreadsinfo_sp) { @@ -1944,7 +1944,7 @@ ProcessGDBRemote::SetThreadStopInfo (lldb::tid_t tid, // m_thread_list_real does have its own mutex, but we need to // hold onto the mutex between the call to m_thread_list_real.FindThreadByID(...) // and the m_thread_list_real.AddThread(...) so it doesn't change on us - Mutex::Locker locker (m_thread_list_real.GetMutex ()); + std::lock_guard guard(m_thread_list_real.GetMutex()); thread_sp = m_thread_list_real.FindThreadByProtocolID(tid, false); if (!thread_sp) @@ -2440,7 +2440,8 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) } else if (key.compare("threads") == 0) { - Mutex::Locker locker(m_thread_list_real.GetMutex()); + std::lock_guard guard(m_thread_list_real.GetMutex()); + m_thread_ids.clear(); // A comma separated list of all threads in the current // process that includes the thread for this stop reply @@ -2663,7 +2664,8 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) void ProcessGDBRemote::RefreshStateAfterStop () { - Mutex::Locker locker(m_thread_list_real.GetMutex()); + std::lock_guard guard(m_thread_list_real.GetMutex()); + m_thread_ids.clear(); m_thread_pcs.clear(); // Set the thread stop info. It might have a "threads" key whose value is @@ -2818,7 +2820,7 @@ ProcessGDBRemote::DoDestroy () ThreadList &threads = GetThreadList(); { - Mutex::Locker locker(threads.GetMutex()); + std::lock_guard guard(threads.GetMutex()); size_t num_threads = threads.GetSize(); for (size_t i = 0; i < num_threads; i++) @@ -2853,7 +2855,7 @@ ProcessGDBRemote::DoDestroy () // have to run the risk of letting those threads proceed a bit. { - Mutex::Locker locker(threads.GetMutex()); + std::lock_guard guard(threads.GetMutex()); size_t num_threads = threads.GetSize(); for (size_t i = 0; i < num_threads; i++) -- cgit v1.2.3