From e959a3b3157e38ebda4ce6f86efb5644faa4988b Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 10 Jul 2014 10:25:26 -0700 Subject: [PATCH] Remove the global lock around thread stack creation. This lock has been here since the original commits, but as far as I can tell it never served any purpose. We've never had a free list of cached stacks or anything like that. Change-Id: I9d665c7eaa9c699ce0659ffb111402a0239fe1f5 --- libc/bionic/pthread_create.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp index d1aeb93fa..174e30807 100644 --- a/libc/bionic/pthread_create.cpp +++ b/libc/bionic/pthread_create.cpp @@ -47,8 +47,6 @@ extern "C" __LIBC_HIDDEN__ void __init_user_desc(struct user_desc*, int, void*); #endif -static pthread_mutex_t g_pthread_stack_creation_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. @@ -104,8 +102,6 @@ int __init_thread(pthread_internal_t* thread, bool add_to_thread_list) { } static void* __create_thread_stack(pthread_internal_t* thread) { - ScopedPthreadMutexLocker lock(&g_pthread_stack_creation_lock); - // Create a new private anonymous map. int prot = PROT_READ | PROT_WRITE; int flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE;