[Lldb-commits] [PATCH] D11296: [LLGS] Get rid of the stdio forwarding thread

Oleksiy Vyalov ovyalov at google.com
Sun Jul 19 15:05:18 PDT 2015


ovyalov added a comment.

Please see my comments.


================
Comment at: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:940
@@ -957,1 +939,3 @@
+        if (! m_stdio_handle_up)
+            return error;
     }
----------------
m_stdio_communication.Disconnect() ?

================
Comment at: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:967
@@ +966,3 @@
+                log->Printf("GDBRemoteCommunicationServerLLGS::%s Stopping stdio forwarding as communication returned status %d (error: %s)", __FUNCTION__, status, error.AsCString());
+            m_stdio_handle_up.reset();
+            return;
----------------
If SendProcessOutput is called from ProcessStateChanged within Monitor thread context we may have a race here:
 - simultaneous access to m_stdio_handle_up from main & monitor threads.
 - MainLoop will be accessed from multiple threads because UnregisterReadObject is called from monitor.


http://reviews.llvm.org/D11296







More information about the lldb-commits mailing list