[Lldb-commits] [PATCH] D133410: [lldb] Fix ThreadedCommunication races

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 7 04:02:34 PDT 2022


labath added inline comments.


================
Comment at: lldb/source/Core/ThreadedCommunication.cpp:113
 
-      if (event_type & eBroadcastBitReadThreadDidExit) {
-        // If the thread exited of its own accord, it either means it
-        // hit an end-of-file condition or an error.
-        status = m_pass_status;
-        if (error_ptr)
-          *error_ptr = std::move(m_pass_error);
+    // Re-check for data, as it might have arrived while we were setting up our
+    // listener.
----------------
mgorny wrote:
> Can you think of any reason not to move listener setup before the first `GetCachedBytes()` call instead of duplicating it?
The only possible reason is "efficiency" (avoiding the creation of the listener and all that goes with it). But I'm definitely not convinced that this actually matters.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133410/new/

https://reviews.llvm.org/D133410



More information about the lldb-commits mailing list