[lldb] Get the TargetAPI lock in SBProcess::IsInstrumentationRuntimePresent
Summary: We should get the TargetAPI lock here to prevent the process of being destroyed while we are in the function. Thanks Jim for explaining what's going on. Fixes rdar://54424754 Reviewers: jingham Reviewed By: jingham Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67831 llvm-svn: 373725
This commit is contained in:
@@ -1180,6 +1180,9 @@ bool SBProcess::IsInstrumentationRuntimePresent(
|
||||
if (!process_sp)
|
||||
return false;
|
||||
|
||||
std::lock_guard<std::recursive_mutex> guard(
|
||||
process_sp->GetTarget().GetAPIMutex());
|
||||
|
||||
InstrumentationRuntimeSP runtime_sp =
|
||||
process_sp->GetInstrumentationRuntime(type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user