From 61dd6208fb1e59a423b6dfa712a3c896c34b2590 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Sat, 15 Jun 2013 12:24:15 +0530 Subject: 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. --- nptl/sysdeps/pthread/pthread.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nptl/sysdeps') diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h index 10bcb806b3..ded5ae59ff 100644 --- a/nptl/sysdeps/pthread/pthread.h +++ b/nptl/sysdeps/pthread/pthread.h @@ -404,6 +404,14 @@ extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr, cpu_set_t *__cpuset) __THROW __nonnull ((1, 3)); +/* Get the default attributes used by pthread_create in this process. */ +extern int pthread_getattr_default_np (pthread_attr_t *__attr) + __THROW __nonnull ((1)); + +/* Set the default attributes to be used by pthread_create in this + process. */ +extern int pthread_setattr_default_np (const pthread_attr_t *__attr) + __THROW __nonnull ((1)); /* Initialize thread attribute *ATTR with attributes corresponding to the already running thread TH. It shall be called on uninitialized ATTR -- cgit v1.2.3