Add code to exit the NativeProcessLinux Monitor thread on android
This CL change the logic used to terminate the monitor thread of NativeProcessLinux to use a signal instead of pthread_cancel as pthread_cancel is not supported on android.
Paths
| Differential D8205
Add code to exit the NativeProcessLinux Monitor thread on android ClosedPublic Authored by tberghammer on Mar 10 2015, 8:24 AM.
Details Summary Add code to exit the NativeProcessLinux Monitor thread on android This CL change the logic used to terminate the monitor thread of NativeProcessLinux to use a signal instead of pthread_cancel as pthread_cancel is not supported on android.
Diff Detail Event Timelinetberghammer retitled this revision from to Add code to exit the NativeProcessLinux Monitor thread on android. tberghammer updated this object. Comment Actions Please see my inline comments on the signal handler. A thought for general discussion: I am wondering whether we could avoid having two methods for shutting down a thread. If the code in question is not likely to be used on windows (which I think it's not as it is just a glorified waitpid() wrapper and waitpid is very posix-y), then all other platforms should support the pthread_kill method and we could use a single approach everywhere. Thoughts?
Comment Actions Please see my comments.
Comment Actions Thanks for the patch! Looking forward to v2!
This revision now requires changes to proceed.Mar 10 2015, 6:10 PM tberghammer updated this object. Comment ActionsThanks for the comments. Based on them I created a new patch which use the same (signal based) logic for Linux and Android. I still left the pthread_cancel logic in place in MonitorChildProcessThreadFunction because it is used in several other case also and I don't have the environment set up to update and test the effect of the change in those cases.
Comment Actions I have an issue with one of the comments, but otherwise looks fine.
Closed by commit rL232155: Add code to exit the NativeProcessLinux Monitor thread on android (authored by tberghammer). · Explain WhyMar 13 2015, 4:18 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 21583 cmake/LLDBDependencies.cmake
source/Host/common/Host.cpp
source/Plugins/Platform/Android/PlatformAndroid.h
source/Plugins/Platform/Android/PlatformAndroid.cpp
source/Plugins/Process/Android/CMakeLists.txt
source/Plugins/Process/Android/Makefile
source/Plugins/Process/Android/NativeProcessAndroid.h
source/Plugins/Process/Android/NativeProcessAndroid.cpp
source/Plugins/Process/CMakeLists.txt
source/Plugins/Process/Linux/NativeProcessLinux.h
source/Plugins/Process/Linux/NativeProcessLinux.cpp
|
Rename to "emptySignalHandler"?
Comment that the signal is only to interrupt the thread from waitpid