summaryrefslogtreecommitdiff
path: root/source/Plugins/ObjectContainer/BSD-Archive
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:50:09 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:50:09 +0000
commitf3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch)
tree48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /source/Plugins/ObjectContainer/BSD-Archive
parent2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff)
Notes
Diffstat (limited to 'source/Plugins/ObjectContainer/BSD-Archive')
-rw-r--r--source/Plugins/ObjectContainer/BSD-Archive/Makefile14
-rw-r--r--source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp12
-rw-r--r--source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h6
3 files changed, 9 insertions, 23 deletions
diff --git a/source/Plugins/ObjectContainer/BSD-Archive/Makefile b/source/Plugins/ObjectContainer/BSD-Archive/Makefile
deleted file mode 100644
index 00c5911ea95f..000000000000
--- a/source/Plugins/ObjectContainer/BSD-Archive/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- source/Plugins/ObjectContainer/BSD-Archive/Makefile -------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LLDB_LEVEL := ../../../..
-LIBRARYNAME := lldbPluginObjectContainerBSDArchive
-BUILD_ARCHIVE = 1
-
-include $(LLDB_LEVEL)/Makefile
diff --git a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index f2a74b05fe26..984a9ece12ef 100644
--- a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/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/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
index cbb3848dc7cd..03b0bf3e2f09 100644
--- a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
+++ b/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,