Change SymbolVendor::GetCompileUnitAtIndex() and SymbolVendor::Dump() to make sure they are thread safe.

<rdar://problem/20263111>

llvm-svn: 234951
This commit is contained in:
Greg Clayton 2015-04-14 22:34:00 +00:00
parent 5560a4cfbd
commit 50bd5a2dc6
1 changed files with 3 additions and 0 deletions

View File

@ -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_t idx)
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)
{