[Lldb-commits] [PATCH] Fix deadlock in operation thread in NativeProcessLinux

Tamas Berghammer tberghammer at google.com
Tue Mar 3 05:25:52 PST 2015


================
Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:3591
@@ +3590,3 @@
+        state != StateType::eStateAttaching &&
+        state != StateType::eStateLaunching)
+    {
----------------
labath wrote:
> Enumerating the states when the thread could have exited on its own seems quite fragile. I would propose a more principled treatment. For example we could make DoOperation not wait on the acknowledgement semaphore in case of an exit operation (it is supposed to be the last operation, and the fact that it was processed is indicated by the fact that Join() returns).
> 
> PS: instead of accompanying every use of nullptr with a comment "nullptr is a code for the exit operation", I would recommend declaring a constant "static void * const EXIT_OPERATION = nullptr" (or something along those lines) and using it. 
I don't like my solution either, but haven't managed to find a better way. Thank you for your suggestion, I updated the CL based on it.

http://reviews.llvm.org/D8030

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list