[Lldb-commits] [lldb] [lldb] fix dead lock in TypeCategoryMap.cpp	(PR #87540)
    Vincent Belliard via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Tue Apr  9 08:37:25 PDT 2024
    
    
  
================
@@ -25,19 +25,25 @@ TypeCategoryMap::TypeCategoryMap(IFormatChangeListener *lst)
 }
 
 void TypeCategoryMap::Add(KeyType name, const TypeCategoryImplSP &entry) {
-  std::lock_guard<std::recursive_mutex> guard(m_map_mutex);
-  m_map[name] = entry;
+  {
+    std::lock_guard<std::recursive_mutex> guard(m_map_mutex);
+    m_map[name] = entry;
+  }
+  // The lock is now released for the eventual call to Changed.
----------------
v-bulle wrote:
done
https://github.com/llvm/llvm-project/pull/87540
    
    
More information about the lldb-commits
mailing list