add threads.h and needed per-arch types for mtx_t and cnd_t
authorRich Felker <dalias@aerifal.cx>
Sun, 7 Sep 2014 00:44:30 +0000 (20:44 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 7 Sep 2014 00:44:30 +0000 (20:44 -0400)
commitb7cf71a190813590860af25b32532b6c360ac502
tree007997502a904975b2f78c3988c8c648c1cb50c5
parentdf7d0dfb9c686df31149d09008ba92834bed9803
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/arm/bits/alltypes.h.in
arch/i386/bits/alltypes.h.in
arch/microblaze/bits/alltypes.h.in
arch/mips/bits/alltypes.h.in
arch/or1k/bits/alltypes.h.in
arch/powerpc/bits/alltypes.h.in
arch/sh/bits/alltypes.h.in
arch/x32/bits/alltypes.h.in
arch/x86_64/bits/alltypes.h.in
include/threads.h [new file with mode: 0644]