From e0f25dda3f38a70e5689e785597c5cf2b68bdcf8 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 9 Jul 2014 22:13:55 -0700 Subject: [PATCH] Remove the obsolete _thread_created_hook. gdb won't even try to use this on Android because it knows we don't support old enough kernels to need it. Bug: 15470251 Change-Id: Ia6d54585d888bbab8ee0490a148a1586b25437b9 --- libc/bionic/pthread_create.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp index 2ded22b0f..d1aeb93fa 100644 --- a/libc/bionic/pthread_create.cpp +++ b/libc/bionic/pthread_create.cpp @@ -41,13 +41,6 @@ #include "private/ErrnoRestorer.h" #include "private/ScopedPthreadMutexLocker.h" -// Used by gdb to track thread creation. See libthread_db. -#ifdef __i386__ -extern "C" __attribute__((noinline)) __attribute__((fastcall)) void _thread_created_hook(pid_t) {} -#else -extern "C" __attribute__((noinline)) void _thread_created_hook(pid_t) {} -#endif - // x86 uses segment descriptors rather than a direct pointer to TLS. #if __i386__ #include @@ -56,8 +49,6 @@ extern "C" __LIBC_HIDDEN__ void __init_user_desc(struct user_desc*, int, void*); static pthread_mutex_t g_pthread_stack_creation_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t g_debugger_notification_lock = PTHREAD_MUTEX_INITIALIZER; - extern "C" int __isthreaded; // This code is used both by each new pthread and the code that initializes the main thread. @@ -258,12 +249,6 @@ int pthread_create(pthread_t* thread_out, pthread_attr_t const* attr, return init_errno; } - // Notify any debuggers about the new thread. - { - ScopedPthreadMutexLocker debugger_locker(&g_debugger_notification_lock); - _thread_created_hook(thread->tid); - } - // Publish the pthread_t and unlock the mutex to let the new thread start running. *thread_out = reinterpret_cast(thread); pthread_mutex_unlock(&thread->startup_handshake_mutex);