forked from OSchip/llvm-project
Change SymbolVendor::GetCompileUnitAtIndex() and SymbolVendor::Dump() to make sure they are thread safe.
<rdar://problem/20263111> llvm-svn: 234951
This commit is contained in:
parent
5560a4cfbd
commit
50bd5a2dc6
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue