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.
Differential D8205
Add code to exit the NativeProcessLinux Monitor thread on android tberghammer on Mar 10 2015, 8:24 AM. Authored by
Details 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 TimelineComment 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!
Comment Actions Thanks 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.
|