freebsd-nq/lib/libthr
John Baldwin dc3566067a Ensure thread library is initialized in pthread_testcancel().
Call _thr_check_init() before reading curthread in pthread_testcancel().

If a constructor in a library creates a semaphore via sem_init() and
then waits for it via sem_wait(), the program can core dump in
_pthread_testcancel() called from sem_wait().  This is because the
semaphore implementation lives in libc, so the library's constructors
can be run before libthr's constructors.

Reported by:	arichardson
Reviewed by:	kib
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D14786
2018-03-21 21:13:26 +00:00
..
arch lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
support Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones 2017-01-20 04:32:19 +00:00
sys spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
tests Use MACHINE_CPUARCH in preference MACHINE for userland. 2017-11-07 09:57:26 +00:00
thread Ensure thread library is initialized in pthread_testcancel(). 2018-03-21 21:13:26 +00:00
libthr.3 Fix markup. 2016-06-04 20:20:14 +00:00
Makefile Add HAS_TESTS to all Makefiles that are currently using the 2017-08-02 08:50:42 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
plockstat.d
pthread.map Add implementation of robust mutexes, hopefully close enough to the 2016-05-17 09:56:22 +00:00