From b7cf71a190813590860af25b32532b6c360ac502 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 6 Sep 2014 20:44:30 -0400 Subject: 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. --- arch/sh/bits/alltypes.h.in | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/sh/bits') diff --git a/arch/sh/bits/alltypes.h.in b/arch/sh/bits/alltypes.h.in index ee7f1373..7446ab47 100644 --- a/arch/sh/bits/alltypes.h.in +++ b/arch/sh/bits/alltypes.h.in @@ -20,6 +20,8 @@ TYPEDEF long suseconds_t; TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t; TYPEDEF struct { union { int __i[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; +TYPEDEF struct { union { int __i[6]; volatile void *volatile __p[6]; } __u; } mtx_t; TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t; +TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } cnd_t; TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t; TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t; -- cgit v1.2.3-70-g09d2