mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
78d401327f
This patch adds the tss_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically tss_create, tss_delete, tss_get, tss_set, and required types. Mostly of the definitions are composed based on POSIX conterparts, including tss_t (pthread_key_t). 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 (thread_local): New macro. (TSS_DTOR_ITERATIONS): Likewise. (tss_t): New type. (tss_dtor_t): Likewise. (tss_create): New function. (tss_get): Likewise. (tss_set): Likewise. (tss_delete): Likewise. * nptl/Makefile (libpthread-routines): Add tss_create, tss_delete, tss_get, and tss_set objects. * nptl/Versions (libpthread) [GLIBC_2.28]: Likewise. * nptl/tss_create.c: New file. * nptl/tss_delete.c: Likewise. * nptl/tss_get.c: Likewise. * nptl/tss_set.c: Likewise. * sysdeps/nptl/threads.h (thread_local): New define. (TSS_DTOR_ITERATIONS): Likewise. (tss_t): New typedef. (tss_dtor_t): Likewise. (tss_create): New prototype. (tss_get): Likewise. (tss_set): Likewise. (tss_delete): Likewise.
58 lines
1.4 KiB
Plaintext
58 lines
1.4 KiB
Plaintext
#if defined ISO11
|
|
|
|
macro ONCE_FLAG_INIT
|
|
macro thread_local
|
|
macro-int-constant TSS_DTOR_ITERATIONS
|
|
|
|
constant thrd_success
|
|
constant thrd_busy
|
|
constant thrd_error
|
|
constant thrd_nomem
|
|
constant thrd_timedout
|
|
|
|
constant mtx_plain
|
|
constant mtx_recursive
|
|
constant mtx_timed
|
|
|
|
type thrd_t
|
|
type thrd_start_t
|
|
type mtx_t
|
|
type once_flag
|
|
type cnd_t
|
|
type tss_t
|
|
type tss_dtor_t
|
|
|
|
function int thrd_create (thrd_t*, thrd_start_t, void*)
|
|
function int thrd_equal (thrd_t, thrd_t)
|
|
function thrd_t thrd_current (void)
|
|
function int thrd_sleep (const struct timespec*, struct timespec*)
|
|
function void thrd_exit (int)
|
|
function int thrd_detach (thrd_t)
|
|
function int thrd_join (thrd_t, int*)
|
|
function void thrd_yield (void)
|
|
|
|
function int mtx_init (mtx_t*, int)
|
|
function int mtx_lock (mtx_t*)
|
|
function int mtx_timedlock (mtx_t*, const struct timespec*)
|
|
function int mtx_trylock (mtx_t*)
|
|
function int mtx_unlock (mtx_t*)
|
|
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*)
|
|
|
|
function int tss_create (tss_t*, tss_dtor_t)
|
|
function {void*} tss_get (tss_t)
|
|
function int tss_set (tss_t, void*)
|
|
function void tss_delete (tss_t)
|
|
|
|
#include "time.h-data"
|
|
|
|
#endif
|