summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangASTSource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Expression/ClangASTSource.cpp')
-rw-r--r--lldb/source/Expression/ClangASTSource.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index 4c31c223b89..605747adb56 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -561,13 +561,14 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context,
}
else
{
- ModuleList &images = m_target->GetImages();
+ ModuleList &target_images = m_target->GetImages();
+ Mutex::Locker modules_locker (target_images.GetMutex());
- for (uint32_t i = 0, e = images.GetSize();
+ for (uint32_t i = 0, e = target_images.GetSize();
i != e;
++i)
{
- lldb::ModuleSP image = images.GetModuleAtIndex(i);
+ lldb::ModuleSP image = target_images.GetModuleAtIndexUnlocked(i);
if (!image)
continue;
@@ -1339,14 +1340,16 @@ ClangASTSource::CompleteNamespaceMap (ClangASTImporter::NamespaceMapSP &namespac
}
else
{
- ModuleList &images = m_target->GetImages();
+ ModuleList &target_images = m_target->GetImages();
+ Mutex::Locker modules_locker(target_images.GetMutex());
+
ClangNamespaceDecl null_namespace_decl;
- for (uint32_t i = 0, e = images.GetSize();
+ for (uint32_t i = 0, e = target_images.GetSize();
i != e;
++i)
{
- lldb::ModuleSP image = images.GetModuleAtIndex(i);
+ lldb::ModuleSP image = target_images.GetModuleAtIndexUnlocked(i);
if (!image)
continue;
OpenPOWER on IntegriCloud