Simplify pthread_create, using more public API.

Change-Id: I08e65ba88ed01436223e4e528631c9e41ec0e7f4
This commit is contained in:
Elliott Hughes
2013-02-12 16:36:04 -08:00
parent 4912782c6a
commit 6d33918207
4 changed files with 31 additions and 41 deletions

View File

@@ -73,12 +73,10 @@ void __libc_init_tls(KernelArgumentBlock& args) {
unsigned stack_size = 128 * 1024;
unsigned stack_bottom = stack_top - stack_size;
pthread_attr_t thread_attr;
pthread_attr_init(&thread_attr);
pthread_attr_setstack(&thread_attr, (void*) stack_bottom, stack_size);
static pthread_internal_t thread;
_init_thread(&thread, gettid(), &thread_attr, (void*) stack_bottom, false);
pthread_attr_init(&thread.attr);
pthread_attr_setstack(&thread.attr, (void*) stack_bottom, stack_size);
_init_thread(&thread, gettid(), false);
static void* tls_area[BIONIC_TLS_SLOTS];
__init_tls(tls_area, &thread);