From 7538d461134bf306e31b40e4032f0c225bb40d51 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 2 Jun 2020 10:33:30 +0200 Subject: nptl: Make pthread_attr_t dynamically extensible This introduces the function __pthread_attr_extension to allocate the extension space, which is freed by pthread_attr_destroy. Reviewed-by: Carlos O'Donell --- sysdeps/nptl/internaltypes.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'sysdeps/nptl/internaltypes.h') diff --git a/sysdeps/nptl/internaltypes.h b/sysdeps/nptl/internaltypes.h index 6d06a76baf..ca57c315d4 100644 --- a/sysdeps/nptl/internaltypes.h +++ b/sysdeps/nptl/internaltypes.h @@ -36,9 +36,10 @@ struct pthread_attr /* Stack handling. */ void *stackaddr; size_t stacksize; - /* Affinity map. */ - cpu_set_t *cpuset; - size_t cpusetsize; + + /* Allocated via a call to __pthread_attr_extension once needed. */ + struct pthread_attr_extension *extension; + void *unused; }; #define ATTR_FLAG_DETACHSTATE 0x0001 @@ -57,6 +58,15 @@ union pthread_attr_transparent struct pthread_attr internal; }; +/* Extension space for pthread attributes. Referenced by the + extension member of struct pthread_attr. */ +struct pthread_attr_extension +{ + /* Affinity map. */ + cpu_set_t *cpuset; + size_t cpusetsize; +}; + /* Mutex attribute data structure. */ struct pthread_mutexattr { -- cgit 1.4.1