diff options
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Target/Process.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Target/Target.cpp | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 40482e715dc..d0008023147 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -5538,6 +5538,12 @@ ProcessRunLock &Process::GetRunLock() { return m_public_run_lock; } +bool Process::CurrentThreadIsPrivateStateThread() +{ + return m_private_state_thread.EqualsThread(Host::GetCurrentThread()); +} + + void Process::Flush() { m_thread_list.Flush(); m_extended_thread_list.Flush(); diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 90ce85f1489..38406214ba1 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -4129,3 +4129,10 @@ Target::TargetEventData::GetModuleListFromEvent(const Event *event_ptr) { module_list = event_data->m_module_list; return module_list; } + +std::recursive_mutex &Target::GetAPIMutex() { + if (GetProcessSP() && GetProcessSP()->CurrentThreadIsPrivateStateThread()) + return m_private_mutex; + else + return m_mutex; +} |