Pass caller names to __pthread_internal_find for better errors.
On http://b/122082295 we had this abort:
12-27 15:29:31.237 10222 10814 10848 F libc : invalid pthread_t 0xb1907960 passed to libc
This wasn't super helpful. We can do better. Now you get something like
this instead:
03-27 02:34:58.754 25329 25329 W libc : invalid pthread_t (0) passed to pthread_join
Test: adb shell crasher
Bug: http://b/123255692
Change-Id: I1d545665a233308480cc3747ec3120e2b6de0453
diff --git a/libc/bionic/pthread_kill.cpp b/libc/bionic/pthread_kill.cpp
index 1531574..8b38f4c 100644
--- a/libc/bionic/pthread_kill.cpp
+++ b/libc/bionic/pthread_kill.cpp
@@ -35,7 +35,7 @@
int pthread_kill(pthread_t t, int sig) {
ErrnoRestorer errno_restorer;
- pid_t tid = pthread_gettid_np(t);
+ pid_t tid = __pthread_internal_gettid(t, "pthread_kill");
// tid gets reset to 0 on thread exit by CLONE_CHILD_CLEARTID.
if (tid == 0 || tid == -1) return ESRCH;