Revert "Cause Fatal error when invalid pthread_id is detected."
Some code like in https://buganizer.corp.google.com/u/0/issues/19942911 need to change first.
This reverts commit 03324780aae9ff28c8acf52debf0ea39120e5ab8.
Change-Id: I13ff1e5b3d0672bae9cde234ffba32fbbf33d338
diff --git a/libc/bionic/pthread_internal.cpp b/libc/bionic/pthread_internal.cpp
index afafad8..1967ccf 100644
--- a/libc/bionic/pthread_internal.cpp
+++ b/libc/bionic/pthread_internal.cpp
@@ -81,16 +81,12 @@
pthread_internal_t* __pthread_internal_find(pthread_t thread_id) {
pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(thread_id);
- {
- ScopedPthreadMutexLocker locker(&g_thread_list_lock);
+ ScopedPthreadMutexLocker locker(&g_thread_list_lock);
- for (pthread_internal_t* t = g_thread_list; t != NULL; t = t->next) {
- if (t == thread) {
- return thread;
- }
+ for (pthread_internal_t* t = g_thread_list; t != NULL; t = t->next) {
+ if (t == thread) {
+ return thread;
}
}
- // TODO: Remove g_thread_list/g_thread_list_lock when the fatal error below doesn't happen.
- __libc_fatal("No such thread: %p", thread);
return NULL;
}