Thread-hardening the SB API calls related to watchpoint operations.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157776 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index 7f8ae45..0fce9ae 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -483,6 +483,10 @@
// Currently we only support one watchpoint per address, with total number
// of watchpoints limited by the hardware which the inferior is running on.
+
+ // Grab the list mutex while doing operations.
+ Mutex::Locker locker;
+ this->GetWatchpointList().GetListMutex(locker);
WatchpointSP matched_sp = m_watchpoint_list.FindByAddress(addr);
if (matched_sp)
{