summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp')
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
index 1cb7ab8eef9..a2bc88872c1 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -263,11 +263,13 @@ AppleObjCRuntime::GetObjCVersion (Process *process, ModuleSP &objc_module_sp)
return eObjC_VersionUnknown;
Target &target = process->GetTarget();
- ModuleList &images = target.GetImages();
- size_t num_images = images.GetSize();
+ ModuleList &target_modules = target.GetImages();
+ Mutex::Locker modules_locker(target_modules.GetMutex());
+
+ size_t num_images = target_modules.GetSize();
for (size_t i = 0; i < num_images; i++)
{
- ModuleSP module_sp = images.GetModuleAtIndex(i);
+ ModuleSP module_sp = target_modules.GetModuleAtIndexUnlocked(i);
// One tricky bit here is that we might get called as part of the initial module loading, but
// before all the pre-run libraries get winnowed from the module list. So there might actually
// be an old and incorrect ObjC library sitting around in the list, and we don't want to look at that.
OpenPOWER on IntegriCloud