[Lldb-commits] [lldb] [lldb] Fix ThreadList assignment race (PR #98293)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 11 02:38:45 PDT 2024


================
@@ -736,11 +734,12 @@ void ThreadList::NotifySelectedThreadChanged(lldb::tid_t tid) {
 
 void ThreadList::Update(ThreadList &rhs) {
   if (this != &rhs) {
-    // Lock both mutexes to make sure neither side changes anyone on us while
-    // the assignment occurs
-    std::scoped_lock<std::recursive_mutex, std::recursive_mutex> guard(GetMutex(), rhs.GetMutex());
+    // Same process implies same mutex...
+    assert(&m_process == &rhs.m_process);
+    assert(&GetMutex() == &GetMutex());
----------------
labath wrote:

yes 🤦 

https://github.com/llvm/llvm-project/pull/98293


More information about the lldb-commits mailing list