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

Pavel Labath labath at google.com
Tue Mar 3 04:33:19 PST 2015


================
Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:3591
@@ +3590,3 @@
+        state != StateType::eStateAttaching &&
+        state != StateType::eStateLaunching)
+    {
----------------
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.

http://reviews.llvm.org/D8030

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






More information about the lldb-commits mailing list