nptl: Add C11 threads cnd_* functions
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 27 Jun 2017 13:55:10 +0000 (10:55 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 24 Jul 2018 17:07:07 +0000 (14:07 -0300)
commit918311a3a3c7679f40e2e95fcaa120f8c74ef479
treeee7d35e1d19f25cdb9876ec300e68cebd27d41e9
parent3c20a679b6e31af07542e56a446e2433fba53a7e
nptl: Add C11 threads cnd_* functions

This patch adds the cnd_* definitions from C11 threads (ISO/IEC 9899:2011),
more specifically cnd_broadcast, cnd_destroy, cnd_init, cnd_signal,
cnd_timedwait, cnd_wait, and required types.

Mostly of the definitions are composed based on POSIX conterparts, and
cnd_t is also based on internal pthreads fields, but with distinct internal
layout to avoid possible issues with code interchange (such as trying to pass
POSIX structure on C11 functions and to avoid inclusion of pthread.h).  The
idea is to make it possible to share POSIX internal implementation for mostly
of the code making adjust where only required.

Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu,
arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu,
microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu,
powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu,
and x86_64-linux-gnu).

Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu,
arm-linux-gnueabhf, and powerpc64le-linux-gnu.

[BZ #14092]
* conform/data/threads.h-data (cnd_t): New type.
(cnd_init): New function.
(cnd_signal): Likewise.
(cnd_broadcast): Likewise.
(cnd_wait): Likewise.
(cnd_timedwait): Likewise.
(cnd_destroy): Likewise.
* nptl/Makefile (libpthread-routines): Add cnd_broadcast,
cnd_destroy, cnd_init, cnd_signal, cnd_timedwait, and cnd_wait
object.
* nptl/Versions (libpthread) [GLIBC_2.28]: Likewise.
* nptl/cnd_broadcast.c: New file.
* nptl/cnd_destroy.c: Likewise.
* nptl/cnd_init.c: Likewise.
* nptl/cnd_signal.c: Likewise.
* nptl/cnd_timedwait.c: Likewise.
* nptl/cnd_wait.c: Likewise.
* sysdeps/nptl/threads.h (cnd_t): New type.
(cnd_init): New prototype.
(cnd_signa): Likewise.
(cnd_broadcast): Likewise.
(cnd_wait): Likewise.
(cnd_timedwait): Likewise.
(cnd_destroy): Likewise.
ChangeLog
conform/data/threads.h-data
nptl/Makefile
nptl/Versions
nptl/cnd_broadcast.c [new file with mode: 0644]
nptl/cnd_destroy.c [new file with mode: 0644]
nptl/cnd_init.c [new file with mode: 0644]
nptl/cnd_signal.c [new file with mode: 0644]
nptl/cnd_timedwait.c [new file with mode: 0644]
nptl/cnd_wait.c [new file with mode: 0644]
nptl/threads.h