diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-05-19 05:13:57 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-05-19 05:13:57 +0000 |
commit | bb19a13c0b3fe1ecdc1e46bbf2b06ffc1e25e04e (patch) | |
tree | a4383c7cf16b2a6b8e8aa1ff61435ceec0c6a7de /lldb/source/Plugins/OperatingSystem | |
parent | fe12d0e3e551a29b880ecfc7673810ce18567765 (diff) | |
download | bcm5719-llvm-bb19a13c0b3fe1ecdc1e46bbf2b06ffc1e25e04e.tar.gz bcm5719-llvm-bb19a13c0b3fe1ecdc1e46bbf2b06ffc1e25e04e.zip |
second pass over removal of Mutex and Condition
llvm-svn: 270024
Diffstat (limited to 'lldb/source/Plugins/OperatingSystem')
-rw-r--r-- | lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp b/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp index c8ed821ddfd..ec0b7014d4d 100644 --- a/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp +++ b/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp @@ -197,7 +197,7 @@ OperatingSystemGo::CreateInstance(Process *process, bool force) if (!target_sp) return nullptr; ModuleList &module_list = target_sp->GetImages(); - Mutex::Locker modules_locker(module_list.GetMutex()); + std::lock_guard<std::recursive_mutex> guard(module_list.GetMutex()); const size_t num_modules = module_list.GetSize(); bool found_go_runtime = false; for (size_t i = 0; i < num_modules; ++i) diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index a556b0e84e8..dfb631e399f 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -183,16 +183,16 @@ OperatingSystemPython::UpdateThreadList (ThreadList &old_thread_list, // This is a recursive lock so we can grant it to any Python code called on // the stack below us. Target &target = m_process->GetTarget(); - Mutex::Locker api_locker; - api_locker.TryLock(target.GetAPIMutex()); - + std::unique_lock<std::recursive_mutex> lock(target.GetAPIMutex(), std::defer_lock); + lock.try_lock(); + if (log) log->Printf ("OperatingSystemPython::UpdateThreadList() fetching thread data from python for pid %" PRIu64, m_process->GetID()); // The threads that are in "new_thread_list" upon entry are the threads from the // lldb_private::Process subclass, no memory threads will be in this list. - - auto lock = m_interpreter->AcquireInterpreterLock(); // to make sure threads_list stays alive + + auto interpreter_lock = m_interpreter->AcquireInterpreterLock(); // to make sure threads_list stays alive StructuredData::ArraySP threads_list = m_interpreter->OSPlugin_ThreadsInfo(m_python_object_sp); const uint32_t num_cores = core_thread_list.GetSize(false); @@ -324,7 +324,7 @@ OperatingSystemPython::CreateRegisterContextForThread (Thread *thread, addr_t re // content of the process, and we're going to use python, which requires the API lock to do it. // So get & hold that. This is a recursive lock so we can grant it to any Python code called on the stack below us. Target &target = m_process->GetTarget(); - Mutex::Locker api_locker (target.GetAPIMutex()); + std::lock_guard<std::recursive_mutex> guard(target.GetAPIMutex()); Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); @@ -399,8 +399,8 @@ OperatingSystemPython::CreateThread (lldb::tid_t tid, addr_t context) // content of the process, and we're going to use python, which requires the API lock to do it. // So get & hold that. This is a recursive lock so we can grant it to any Python code called on the stack below us. Target &target = m_process->GetTarget(); - Mutex::Locker api_locker (target.GetAPIMutex()); - + std::lock_guard<std::recursive_mutex> guard(target.GetAPIMutex()); + auto lock = m_interpreter->AcquireInterpreterLock(); // to make sure thread_info_dict stays alive StructuredData::DictionarySP thread_info_dict = m_interpreter->OSPlugin_CreateThread(m_python_object_sp, tid, context); std::vector<bool> core_used_map; |