[Lldb-commits] [lldb] [lldb] Synchronize access to m_statusline in the Debugger (PR #134759)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 8 11:37:40 PDT 2025


================
@@ -391,8 +392,13 @@ bool Debugger::SetTerminalWidth(uint64_t term_width) {
 
   if (auto handler_sp = m_io_handler_stack.Top())
     handler_sp->TerminalSizeChanged();
-  if (m_statusline)
-    m_statusline->TerminalSizeChanged();
+
+  {
+    // This might get called from a signal handler.
+    std::unique_lock<std::mutex> lock(m_statusline_mutex, std::try_to_lock);
+    if (m_statusline)
----------------
JDevlieghere wrote:

My reasoning for doing it on the lldb_private side was that then I could decide whether to lock or not, but I guess that if we use the signal handling thread, that's not a concern anymore as we will just queue the requests. Let me see what it would take to add this to the driver. 

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


More information about the lldb-commits mailing list