summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-05-19 05:13:57 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-05-19 05:13:57 +0000
commitbb19a13c0b3fe1ecdc1e46bbf2b06ffc1e25e04e (patch)
treea4383c7cf16b2a6b8e8aa1ff61435ceec0c6a7de /lldb/source/Commands/CommandObjectTarget.cpp
parentfe12d0e3e551a29b880ecfc7673810ce18567765 (diff)
downloadbcm5719-llvm-bb19a13c0b3fe1ecdc1e46bbf2b06ffc1e25e04e.tar.gz
bcm5719-llvm-bb19a13c0b3fe1ecdc1e46bbf2b06ffc1e25e04e.zip
second pass over removal of Mutex and Condition
llvm-svn: 270024
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 1e7f1e54cc6..45d372cba02 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -1548,7 +1548,7 @@ static size_t
DumpModuleObjfileHeaders(Stream &strm, ModuleList &module_list)
{
size_t num_dumped = 0;
- 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();
if (num_modules > 0)
{
@@ -2302,7 +2302,7 @@ protected:
if (command.GetArgumentCount() == 0)
{
// Dump all sections for all modules images
- Mutex::Locker modules_locker(target->GetImages().GetMutex());
+ std::lock_guard<std::recursive_mutex> guard(target->GetImages().GetMutex());
const size_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
@@ -2532,7 +2532,7 @@ protected:
{
// Dump all sections for all modules images
const ModuleList &target_modules = target->GetImages();
- Mutex::Locker modules_locker (target_modules.GetMutex());
+ std::lock_guard<std::recursive_mutex> guard(target_modules.GetMutex());
const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
@@ -2633,7 +2633,7 @@ protected:
FileSpec file_spec(arg_cstr, false);
const ModuleList &target_modules = target->GetImages();
- Mutex::Locker modules_locker(target_modules.GetMutex());
+ std::lock_guard<std::recursive_mutex> guard(target_modules.GetMutex());
const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
@@ -3296,7 +3296,6 @@ protected:
// Otherwise it will lock the AllocationModuleCollectionMutex when accessing
// the global module list directly.
std::unique_lock<std::recursive_mutex> guard(Module::GetAllocationModuleCollectionMutex(), std::defer_lock);
- Mutex::Locker locker;
const ModuleList *module_list_ptr = nullptr;
const size_t argc = command.GetArgumentCount();
@@ -3333,10 +3332,11 @@ protected:
module_list_ptr = &module_list;
}
+ std::unique_lock<std::recursive_mutex> lock;
if (module_list_ptr != nullptr)
{
- assert(use_global_module_list == false && "locking violation");
- locker.Lock(module_list_ptr->GetMutex());
+ lock = std::unique_lock<std::recursive_mutex>(module_list_ptr->GetMutex());
+
num_modules = module_list_ptr->GetSize();
}
@@ -4239,7 +4239,7 @@ protected:
// Dump all sections for all other modules
const ModuleList &target_modules = target->GetImages();
- Mutex::Locker modules_locker(target_modules.GetMutex());
+ std::lock_guard<std::recursive_mutex> guard(target_modules.GetMutex());
const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
OpenPOWER on IntegriCloud