diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-06-27 10:55:10 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2018-07-24 14:07:07 -0300 |
commit | 918311a3a3c7679f40e2e95fcaa120f8c74ef479 (patch) | |
tree | ee7d35e1d19f25cdb9876ec300e68cebd27d41e9 /conform | |
parent | 3c20a679b6e31af07542e56a446e2433fba53a7e (diff) | |
download | glibc-918311a3a3c7679f40e2e95fcaa120f8c74ef479.tar.gz glibc-918311a3a3c7679f40e2e95fcaa120f8c74ef479.tar.xz glibc-918311a3a3c7679f40e2e95fcaa120f8c74ef479.zip |
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.
Diffstat (limited to 'conform')
-rw-r--r-- | conform/data/threads.h-data | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/conform/data/threads.h-data b/conform/data/threads.h-data index 70b2fe03ca..d7c562eb19 100644 --- a/conform/data/threads.h-data +++ b/conform/data/threads.h-data @@ -16,6 +16,7 @@ type thrd_t type thrd_start_t type mtx_t type once_flag +type cnd_t function int thrd_create (thrd_t*, thrd_start_t, void*) function int thrd_equal (thrd_t, thrd_t) @@ -35,6 +36,13 @@ function void mtx_destroy (mtx_t*) function void call_once (once_flag*, void (*)(void)) +function int cnd_init (cnd_t*) +function int cnd_signal (cnd_t*) +function int cnd_broadcast (cnd_t*) +function int cnd_wait (cnd_t*, mtx_t*) +function int cnd_timedwait (cnd_t*, mtx_t*, const struct timespec*) +function void cnd_destroy (cnd_t*) + #include "time.h-data" #endif |