diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-05-18 01:59:10 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-05-18 01:59:10 +0000 |
| commit | 16ff8604690ea63a3a82dd3b156061afb84dbcf1 (patch) | |
| tree | a2d912258ecb0690f4a810ca1e438fc277160326 /lldb/source/Plugins/ObjectContainer | |
| parent | a36a61d46ac3f2ea10e78ac816bca5784bc8ba35 (diff) | |
| download | bcm5719-llvm-16ff8604690ea63a3a82dd3b156061afb84dbcf1.tar.gz bcm5719-llvm-16ff8604690ea63a3a82dd3b156061afb84dbcf1.zip | |
remove use of Mutex in favour of std::{,recursive_}mutex
This is a pretty straightforward first pass over removing a number of uses of
Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there
are interfaces which take Mutex::Locker & to lock internal locks. This patch
cleans up most of the easy cases. The only non-trivial change is in
CommandObjectTarget.cpp where a Mutex::Locker was split into two.
llvm-svn: 269877
Diffstat (limited to 'lldb/source/Plugins/ObjectContainer')
| -rw-r--r-- | lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp | 12 | ||||
| -rw-r--r-- | lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index f2a74b05fe2..984a9ece12e 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -35,7 +35,6 @@ typedef struct ar_hdr #include "lldb/Core/PluginManager.h" #include "lldb/Core/Stream.h" #include "lldb/Core/Timer.h" -#include "lldb/Host/Mutex.h" #include "lldb/Symbol/ObjectFile.h" using namespace lldb; @@ -226,7 +225,7 @@ ObjectContainerBSDArchive::Archive::FindObject (const ConstString &object_name, ObjectContainerBSDArchive::Archive::shared_ptr ObjectContainerBSDArchive::Archive::FindCachedArchive (const FileSpec &file, const ArchSpec &arch, const TimeValue &time, lldb::offset_t file_offset) { - Mutex::Locker locker(Archive::GetArchiveCacheMutex ()); + std::lock_guard<std::recursive_mutex> guard(Archive::GetArchiveCacheMutex()); shared_ptr archive_sp; Archive::Map &archive_map = Archive::GetArchiveCache (); Archive::Map::iterator pos = archive_map.find (file); @@ -281,7 +280,7 @@ ObjectContainerBSDArchive::Archive::ParseAndCacheArchiveForFile const size_t num_objects = archive_sp->ParseObjects (); if (num_objects > 0) { - Mutex::Locker locker(Archive::GetArchiveCacheMutex ()); + std::lock_guard<std::recursive_mutex> guard(Archive::GetArchiveCacheMutex()); Archive::GetArchiveCache().insert(std::make_pair(file, archive_sp)); } else @@ -299,14 +298,13 @@ ObjectContainerBSDArchive::Archive::GetArchiveCache () return g_archive_map; } -Mutex & -ObjectContainerBSDArchive::Archive::GetArchiveCacheMutex () +std::recursive_mutex & +ObjectContainerBSDArchive::Archive::GetArchiveCacheMutex() { - static Mutex g_archive_map_mutex (Mutex::eMutexTypeRecursive); + static std::recursive_mutex g_archive_map_mutex; return g_archive_map_mutex; } - void ObjectContainerBSDArchive::Initialize() { diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h index cbb3848dc7c..03b0bf3e2f0 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h @@ -12,6 +12,8 @@ // C Includes // C++ Includes +#include <mutex> + // Other libraries and framework includes // Project includes #include "lldb/Symbol/ObjectContainer.h" @@ -138,8 +140,8 @@ protected: static Map & GetArchiveCache (); - static lldb_private::Mutex & - GetArchiveCacheMutex (); + static std::recursive_mutex & + GetArchiveCacheMutex(); static Archive::shared_ptr FindCachedArchive (const lldb_private::FileSpec &file, |

