aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/pthread_attr.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-02-12 16:36:04 -0800
committerElliott Hughes <enh@google.com>2013-02-12 16:36:04 -0800
commit6d339182070b035ca94f19bc37c94f4d9813c374 (patch)
tree3745d21667b8c856276c85cf0864d6ab483f83cf /libc/bionic/pthread_attr.cpp
parent4912782c6af7169686acc9553fb0bb33251b0d0d (diff)
downloadandroid_bionic-6d339182070b035ca94f19bc37c94f4d9813c374.tar.gz
android_bionic-6d339182070b035ca94f19bc37c94f4d9813c374.tar.bz2
android_bionic-6d339182070b035ca94f19bc37c94f4d9813c374.zip
Simplify pthread_create, using more public API.
Change-Id: I08e65ba88ed01436223e4e528631c9e41ec0e7f4
Diffstat (limited to 'libc/bionic/pthread_attr.cpp')
-rw-r--r--libc/bionic/pthread_attr.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/libc/bionic/pthread_attr.cpp b/libc/bionic/pthread_attr.cpp
index 831a28e14..c47f95e22 100644
--- a/libc/bionic/pthread_attr.cpp
+++ b/libc/bionic/pthread_attr.cpp
@@ -30,19 +30,15 @@
#include "pthread_internal.h"
-#define DEFAULT_STACKSIZE (1024 * 1024)
-
-const pthread_attr_t gDefaultPthreadAttr = {
- .flags = 0,
- .stack_base = NULL,
- .stack_size = DEFAULT_STACKSIZE,
- .guard_size = PAGE_SIZE,
- .sched_policy = SCHED_NORMAL,
- .sched_priority = 0
-};
+#define DEFAULT_STACK_SIZE (1024 * 1024)
int pthread_attr_init(pthread_attr_t* attr) {
- *attr = gDefaultPthreadAttr;
+ attr->flags = 0;
+ attr->stack_base = NULL;
+ attr->stack_size = DEFAULT_STACK_SIZE;
+ attr->guard_size = PAGE_SIZE;
+ attr->sched_policy = SCHED_NORMAL;
+ attr->sched_priority = 0;
return 0;
}