Now that we have dynamic values, we need to protect the GetChildAtIndex()
calls with the target API mutex.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131762 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index 4ed2c7d..03ac127 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -348,6 +348,9 @@
 {
     lldb::ValueObjectSP child_sp;
 
+    if (m_opaque_sp->GetUpdatePoint().GetTarget())
+        Mutex::Locker api_locker (m_opaque_sp->GetUpdatePoint().GetTarget()->GetAPIMutex());
+
     if (m_opaque_sp)
     {
         child_sp = m_opaque_sp->GetChildAtIndex (idx, true);
@@ -401,6 +404,10 @@
     lldb::ValueObjectSP child_sp;
     const ConstString str_name (name);
 
+    if (m_opaque_sp->GetUpdatePoint().GetTarget())
+        Mutex::Locker api_locker (m_opaque_sp->GetUpdatePoint().GetTarget()->GetAPIMutex());
+    
+
     if (m_opaque_sp)
     {
         child_sp = m_opaque_sp->GetChildMemberWithName (str_name, true);