about summary refs log tree commit diff
path: root/nptl/nptl-init.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2013-06-15 12:24:15 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2013-06-15 12:24:15 +0530
commit61dd6208fb1e59a423b6dfa712a3c896c34b2590 (patch)
tree3417035a17046120bfedeafe2e7db9e366380101 /nptl/nptl-init.c
parent601eb33debf0c7548f52ba72cec4b3f362105e39 (diff)
downloadglibc-61dd6208fb1e59a423b6dfa712a3c896c34b2590.tar.gz
glibc-61dd6208fb1e59a423b6dfa712a3c896c34b2590.tar.xz
glibc-61dd6208fb1e59a423b6dfa712a3c896c34b2590.zip
New API to set default thread attributes
This patch introduces two new convenience functions to set the default
thread attributes used for creating threads.  This allows a programmer
to set the default thread attributes just once in a process and then
run pthread_create without additional attributes.
Diffstat (limited to 'nptl/nptl-init.c')
-rw-r--r--nptl/nptl-init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 63fb729fc6..4e99a38e9e 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -423,8 +423,10 @@ __pthread_initialize_minimal_internal (void)
 
   /* Round the resource limit up to page size.  */
   limit.rlim_cur = (limit.rlim_cur + pagesz - 1) & -pagesz;
+  lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
   __default_pthread_attr.stacksize = limit.rlim_cur;
   __default_pthread_attr.guardsize = GLRO (dl_pagesize);
+  lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
 
 #ifdef SHARED
   /* Transfer the old value from the dynamic linker's internal location.  */