Author: gclayton
Date: Tue Apr 14 17:34:00 2015
New Revision: 234951

URL: http://llvm.org/viewvc/llvm-project?rev=234951&view=rev
Log:
Change SymbolVendor::GetCompileUnitAtIndex() and SymbolVendor::Dump() to make 
sure they are thread safe. 

<rdar://problem/20263111>

Modified:
    lldb/trunk/source/Symbol/SymbolVendor.cpp

Modified: lldb/trunk/source/Symbol/SymbolVendor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolVendor.cpp?rev=234951&r1=234950&r2=234951&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolVendor.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolVendor.cpp Tue Apr 14 17:34:00 2015
@@ -380,6 +380,8 @@ SymbolVendor::Dump(Stream *s)
     ModuleSP module_sp(GetModule());
     if (module_sp)
     {
+        lldb_private::Mutex::Locker locker(module_sp->GetMutex());
+
         bool show_context = false;
 
         s->Printf("%p: ", static_cast<void*>(this));
@@ -423,6 +425,7 @@ SymbolVendor::GetCompileUnitAtIndex(size
     ModuleSP module_sp(GetModule());
     if (module_sp)
     {
+        lldb_private::Mutex::Locker locker(module_sp->GetMutex());
         const size_t num_compile_units = GetNumCompileUnits();
         if (idx < num_compile_units)
         {


_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to