[Lldb-commits] [PATCH] Fix deadlock in operation thread in NativeProcessLinux
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)
> 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.
More information about the lldb-commits