Merge "Remove the obsolete _thread_created_hook."

This commit is contained in:
Elliott Hughes 2014-07-10 17:10:22 +00:00 committed by Gerrit Code Review
commit cd23370ca7

View File

@ -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 <asm/ldt.h>
@ -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<pthread_t>(thread);
pthread_mutex_unlock(&thread->startup_handshake_mutex);