freebsd-nq/lib/libthr
Konstantin Belousov 6044c03a37 Apparently there are some popular programs around which assume that it
is safe to call pthread_mutex_init() on the same shared mutex several
times.  POSIX claims that the behaviour in this case is undefined.

Make this working by only allowing one caller to initialize the mutex.
Other callers either see already completed initialization and do
nothing, or busy-loop yielding while designated initializer finishes.
Also make the API requirements loose by initializing mutexes on other
pthread_mutex*() calls if they see uninitialized shared mutex.

Only mutexes provide the hack for now, but it could be also
implemented for other process shared primitives from libthr.

Reported and tested by:	"Oleg V. Nauman" <oleg@opentransfer.com>
Sponsored by:	The FreeBSD Foundation
2016-03-22 10:51:42 +00:00
..
arch Add pthread MD part for RISC-V. 2016-01-27 14:10:50 +00:00
support
sys Fix known issues which blow up the process after dlopen("libthr.so") 2015-01-03 18:38:46 +00:00
tests DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
thread Apparently there are some popular programs around which assume that it 2016-03-22 10:51:42 +00:00
libthr.3 errno(3) -> errno(2) 2016-02-29 17:34:54 +00:00
Makefile Fix typo. 2016-03-21 05:59:05 +00:00
Makefile.depend META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host. 2015-11-25 19:10:28 +00:00
plockstat.d Add the DTrace probe definitions for plockstat support. 2014-07-05 19:49:31 +00:00
pthread.map If libthr.so is dlopened without RTLD_GLOBAL flag, the libthr symbols 2016-02-08 19:24:13 +00:00