freebsd-skq/lib/libc
kib 117ade20e9 Add __cxa_thread_atexit(3) API implementation.
This is the backing feature to implement C++11 thread storage duration
specified by the thread_local keyword.  A destructor for given
thread-local object is registered to be executed at the thread
termination time using __cxa_thread_atexit().  Libc calls the
__cxa_thread_calls_dtors() during exit(3), before finalizers and
atexit functions, and libthr calls the function at the thread
termination time, after the stack unwinding and thread-specific key
destruction.

There are several uncertainties in the API which lacks a formal
specification.  Among them:
- is it allowed to register destructors during destructing;
	we allow, but limiting the nesting level.  If too many iterations
	detected, a diagnostic is issued to stderr and thread forcibly
	terminates for now.
- how to handle destructors which belong to an unloading dso;
	for now, we ignore destructor calls for such entries, and
	issue a diagnostic.  Linux does prevent dso unload until all
	threads with destructors from the dso terminated.
It is supposed that the diagnostics allow to detect real-world
applications relying on the above details and possibly adjust
our implementation.  Right now the choices were to provide the slim
API (but that rarely stands the practice test).

Tests are added to check generic functionality and to specify some of
the above implementation choices.

Submitted by:	Mahdi Mokhtari <mokhi64_gmail.com>
Reviewed by:	theraven
Discussed with:	dim (detection of -std=c++11 supoort for tests)
Sponsored by:	The FreeBSD Foundation (my involvement)
MFC after:	2 weeks
Differential revisions:	https://reviews.freebsd.org/D7224,
    https://reviews.freebsd.org/D7427
2016-08-06 13:32:40 +00:00
..
aarch64 Replace use of the pipe(2) system call with pipe2(2) with a zero flags 2016-06-22 21:11:27 +00:00
amd64 Replace use of the pipe(2) system call with pipe2(2) with a zero flags 2016-06-22 21:11:27 +00:00
arm Replace use of the pipe(2) system call with pipe2(2) with a zero flags 2016-06-22 21:11:27 +00:00
capability
compat-43
db
gdtoa
gen Grammar fixes. 2016-08-04 11:38:53 +00:00
gmon
i386 Replace use of the pipe(2) system call with pipe2(2) with a zero flags 2016-06-22 21:11:27 +00:00
iconv
include Add __cxa_thread_atexit(3) API implementation. 2016-08-06 13:32:40 +00:00
inet
isc
locale Change the return type of freelocale(3) to void. 2016-07-29 17:18:47 +00:00
md
mips Replace use of the pipe(2) system call with pipe2(2) with a zero flags 2016-06-22 21:11:27 +00:00
nameser
net Add NI_NUMERICSCOPE. 2016-07-28 10:05:41 +00:00
nls
posix1e
powerpc Replace use of the pipe(2) system call with pipe2(2) with a zero flags 2016-06-22 21:11:27 +00:00
powerpc64 Replace use of the pipe(2) system call with pipe2(2) with a zero flags 2016-06-22 21:11:27 +00:00
quad
regex 1) Eliminate possibility to call __*collate_range_cmp() with inclomplete 2016-07-14 09:07:25 +00:00
resolv Don't leak addrinfo if ai->ai_addrlen <= minsiz test fails. 2016-06-08 09:40:06 +00:00
riscv Replace use of the pipe(2) system call with pipe2(2) with a zero flags 2016-06-22 21:11:27 +00:00
rpc Use on crypto.x and rpc.x from the source tree. 2016-06-28 19:53:16 +00:00
secure
softfloat
sparc64 Replace use of the pipe(2) system call with pipe2(2) with a zero flags 2016-06-22 21:11:27 +00:00
stdio Remove usage of _WITH_DPRINTF 2016-07-30 01:16:06 +00:00
stdlib Add __cxa_thread_atexit(3) API implementation. 2016-08-06 13:32:40 +00:00
stdtime
string
sys mprotect(): Change prototype to comply to POSIX. 2016-08-03 06:33:04 +00:00
tests Add __cxa_thread_atexit(3) API implementation. 2016-08-06 13:32:40 +00:00
uuid
xdr
yp Use on crypto.x and rpc.x from the source tree. 2016-06-28 19:53:16 +00:00
libc.ldscript
Makefile
Makefile.depend
Versions.def Create namespace for the symbols added during 12-CURRENT cycle. 2016-08-06 13:28:58 +00:00