diff options
author | Florian Weimer <fweimer@redhat.com> | 2020-06-02 10:33:30 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2020-06-02 11:54:58 +0200 |
commit | 7538d461134bf306e31b40e4032f0c225bb40d51 (patch) | |
tree | 34c4ceb7c6565864dfc62d8e23dd8f37e24944af /sysdeps/nptl/internaltypes.h | |
parent | 6993670b52daa413717e840dfb17b5322e7f4a88 (diff) | |
download | glibc-7538d461134bf306e31b40e4032f0c225bb40d51.tar.gz glibc-7538d461134bf306e31b40e4032f0c225bb40d51.tar.xz glibc-7538d461134bf306e31b40e4032f0c225bb40d51.zip |
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 <carlos@redhat.com>
Diffstat (limited to 'sysdeps/nptl/internaltypes.h')
-rw-r--r-- | sysdeps/nptl/internaltypes.h | 16 |
1 files changed, 13 insertions, 3 deletions
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 { |