Simplify pthread_create, using more public API.
Change-Id: I08e65ba88ed01436223e4e528631c9e41ec0e7f4
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp
index 881b091..266d6fa 100644
--- a/libc/bionic/libc_init_common.cpp
+++ b/libc/bionic/libc_init_common.cpp
@@ -73,12 +73,10 @@
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);