about summary refs log tree commit diff
path: root/conform
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-06-27 10:49:51 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2018-07-24 14:07:01 -0300
commit3c20a679b6e31af07542e56a446e2433fba53a7e (patch)
treeb75bced95246c531ddd88d0f9429fbea145948ac /conform
parent18d59c1b36e97d438ed964eb483c119517c18fee (diff)
downloadglibc-3c20a679b6e31af07542e56a446e2433fba53a7e.tar.gz
glibc-3c20a679b6e31af07542e56a446e2433fba53a7e.tar.xz
glibc-3c20a679b6e31af07542e56a446e2433fba53a7e.zip
nptl: Add C11 threads call_once functions
This patch adds the call_* definitions from C11 threads (ISO/IEC 9899:2011),
more specifically call_once and required types.

Mostly of the definitions are composed based on POSIX conterparts,including
once_flag (pthread_once_t).  The idea is to make possible to share POSIX
internal implementations for mostly of the code (and making adjustment only
when 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 (ONCE_FLAG_INIT): New macro.
	(once_flag): New type.
	(call_once): New function.
	* nptl/Makefile (libpthread-routines): Add call_once object.
	* nptl/Versions (libphread) [GLIBC_2.28]: Add call_once symbol.
	* nptl/call_once.c: New file.
	* sysdeps/nptl/threads.h (ONCE_FLAG_INIT): New define.
	(once_flag): New type.
	(call_once): New prototype.
Diffstat (limited to 'conform')
-rw-r--r--conform/data/threads.h-data5
1 files changed, 5 insertions, 0 deletions
diff --git a/conform/data/threads.h-data b/conform/data/threads.h-data
index bb5ca75524..70b2fe03ca 100644
--- a/conform/data/threads.h-data
+++ b/conform/data/threads.h-data
@@ -1,5 +1,7 @@
 #if defined ISO11
 
+macro ONCE_FLAG_INIT
+
 constant thrd_success
 constant thrd_busy
 constant thrd_error
@@ -13,6 +15,7 @@ constant mtx_timed
 type thrd_t
 type thrd_start_t
 type mtx_t
+type once_flag
 
 function int thrd_create (thrd_t*, thrd_start_t, void*)
 function int thrd_equal (thrd_t, thrd_t)
@@ -30,6 +33,8 @@ 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))
+
 #include "time.h-data"
 
 #endif