summaryrefslogtreecommitdiff
path: root/arch/x86_64
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-09-06 20:44:30 -0400
committerRich Felker <dalias@aerifal.cx>2014-09-06 20:44:30 -0400
commitb7cf71a190813590860af25b32532b6c360ac502 (patch)
tree007997502a904975b2f78c3988c8c648c1cb50c5 /arch/x86_64
parentdf7d0dfb9c686df31149d09008ba92834bed9803 (diff)
downloadmusl-b7cf71a190813590860af25b32532b6c360ac502.tar.gz
musl-b7cf71a190813590860af25b32532b6c360ac502.tar.bz2
musl-b7cf71a190813590860af25b32532b6c360ac502.tar.xz
musl-b7cf71a190813590860af25b32532b6c360ac502.zip
add threads.h and needed per-arch types for mtx_t and cnd_t
based on patch by Jens Gustedt. mtx_t and cnd_t are defined in such a way that they are formally "compatible types" with pthread_mutex_t and pthread_cond_t, respectively, when accessed from a different translation unit. this makes it possible to implement the C11 functions using the pthread functions (which will dereference them with the pthread types) without having to use the same types, which would necessitate either namespace violations (exposing pthread type names in threads.h) or incompatible changes to the C++ name mangling ABI for the pthread types. for the rest of the types, things are much simpler; using identical types is possible without any namespace considerations.
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/bits/alltypes.h.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86_64/bits/alltypes.h.in b/arch/x86_64/bits/alltypes.h.in
index 7b4f3e72..2ce8e4a5 100644
--- a/arch/x86_64/bits/alltypes.h.in
+++ b/arch/x86_64/bits/alltypes.h.in
@@ -25,6 +25,8 @@ TYPEDEF long suseconds_t;
TYPEDEF struct { union { int __i[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
TYPEDEF struct { union { int __i[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t;
+TYPEDEF struct { union { int __i[10]; volatile void *volatile __p[5]; } __u; } mtx_t;
TYPEDEF struct { union { int __i[12]; void *__p[6]; } __u; } pthread_cond_t;
+TYPEDEF struct { union { int __i[12]; void *__p[6]; } __u; } cnd_t;
TYPEDEF struct { union { int __i[14]; void *__p[7]; } __u; } pthread_rwlock_t;
TYPEDEF struct { union { int __i[8]; void *__p[4]; } __u; } pthread_barrier_t;