freebsd-skq/lib
mtm d835c0621f Make libthr async-signal-safe without costly signal masking. The guidlines I
followed are: Only 3 functions (pthread_cancel, pthread_setcancelstate,
pthread_setcanceltype) are required to be async-signal-safe by POSIX. None of
the rest of the pthread api is required to be async-signal-safe. This means
that only the three mentioned functions are safe to use from inside
signal handlers.
However, there are certain system/libc calls that are
cancellation points that a caller may call from within a signal handler,
and since they are cancellation points calls have to be made into libthr
to test for cancellation and exit the thread if necessary. So, the
cancellation test and thread exit code paths must be async-signal-safe
as well. A summary of the changes follows:

o Almost all of the code paths that masked signals, as well as locking the
  pthread structure now lock only the pthread structure.
o Signals are masked (and left that way) as soon as a thread enters
  pthread_exit().
o The active and dead threads locks now explicitly require that signals
  are masked.
o Access to the isdead field of the pthread structure is protected by both
  the active and dead list locks for writing. Either one is sufficient for
  reading.
o The thread state and type fields have been combined into one three-state
  switch to make it easier to read without requiring a lock. It doesn't need
  a lock for writing (and therefore for reading either) because only the
  current thread can write to it and it is an integer value.
o The thread state field of the pthread structure has been eliminated. It
  was an unnecessary field that mostly duplicated the flags field, but
  required additional locking that would make a lot more code paths require
  signal masking. Any truly unique values (such as PS_DEAD) have been
  reborn as separate members of the pthread structure.
o Since the mutex and condvar pthread functions are not async-signal-safe
  there is no need to muck about with the wait queues when handling
  a signal ...
o ... which also removes the need for wrapping signal handlers and sigaction(2).
o The condvar and mutex async-cancellation code had to be revised as a result
  of some of these changes, which resulted in semi-unrelated changes which
  would have been difficult to work on as a separate commit, so they are
  included as well.

The only part of the changes I am worried about is related to locking for
the pthread joining fields. But, I will take a closer look at them once this
mega-patch is committed.
2004-05-20 12:06:16 +00:00
..
compat Update with the 4.9 pam modules, and add pam_opieaccess.so to the mix. 2003-12-07 03:02:27 +00:00
csu C runtime support for FreeBSD/arm. 2004-05-14 12:19:04 +00:00
libalias Unbreak natd. 2004-04-02 17:57:57 +00:00
libarchive Nits fixed. 2004-05-20 06:22:42 +00:00
libatm Use WARNS?=3 for these in the arm case for now, due to toolchain issues. 2004-05-14 13:31:21 +00:00
libbind
libbluetooth Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror) 2004-03-05 08:10:19 +00:00
libbsnmp Use a MANFILTER to patch the man pages to point to the right path. 2004-04-14 16:31:54 +00:00
libbz2
libc Remove a long obsolete paragraph from the BUGS section. 2004-05-19 03:25:17 +00:00
libc_r style cleanup: Remove duplicate $FreeBSD$ tags. 2004-02-10 20:45:28 +00:00
libcalendar
libcam Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
libcom_err
libcompat
libcrypt
libdevinfo
libdevstat Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
libdisk Remove spurious semicolons. Outside of functions they are actually errors but 2004-05-16 22:08:17 +00:00
libedit
libexpat
libfetch Slight tweak to previous commit: don't forget to call _http_seterr() if 2004-02-11 09:35:27 +00:00
libform
libftpio
libgeom Make libgeom usable by C++ programs: 2004-03-09 21:14:18 +00:00
libio Remove now redundant and now conflicting declaration of sysarch(2). 2004-01-10 18:37:11 +00:00
libipsec Initial import of RFC 2385 (TCP-MD5) digest support. 2004-02-11 04:34:34 +00:00
libipx
libisc
libkiconv Fixed misspellings of '\0' as NULL. 2004-03-14 05:14:00 +00:00
libkse Arm bits for libpthread. It has no chances to work and should be considered 2004-05-14 12:21:29 +00:00
libkvm Implement crashdump decoding for AMD64 as well, now that I have finally 2004-05-19 18:24:13 +00:00
libmd Backed out rev.1.6 and subsequent copying of it (bogus addition of 2004-02-26 07:44:37 +00:00
libmenu
libmilter
libmp
libncp Fixed a misspelling of 0 as NULL. Removed a spelling of NULL as 0. 2004-03-14 05:19:38 +00:00
libncurses
libnetgraph Increment WARNS. 2004-01-28 00:11:42 +00:00
libngatm style.Makefile: 2004-02-23 20:07:47 +00:00
libopie Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
libpam Add -DDEBUG to DEBUG_FLAGS if PAM_DEBUG is defined. 2004-03-15 13:23:20 +00:00
libpanel
libpcap Merge of libpcap 0.8.3 from tcpdump.org. 2004-03-31 09:15:09 +00:00
libpthread Arm bits for libpthread. It has no chances to work and should be considered 2004-05-14 12:21:29 +00:00
libpthread_dbg Add missing file. 2004-02-04 06:32:45 +00:00
libradius Put crypto-aware version of the library into the right distribution. 2004-05-12 06:31:36 +00:00
librpcsvc clnt_call takes args of type xdrproc_t. 2003-10-26 03:43:35 +00:00
libsbuf
libsdp Make sure Bluetooth stuff can be compiled on amd64 2004-04-09 23:01:42 +00:00
libsm
libsmb
libsmdb
libsmutil
libstand Define iaddr_t and saddr_t for arm. 2004-05-14 13:32:13 +00:00
libtacplus Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
libtelnet
libthr Make libthr async-signal-safe without costly signal masking. The guidlines I 2004-05-20 12:06:16 +00:00
libufs Remove unneccessary include of sys/types.h in the SYNOPSIS 2003-10-09 09:45:20 +00:00
libugidfw Fixed misspellings of 0 as NULL. 2004-03-11 09:56:04 +00:00
libusbhid Do not cast dval. 2004-02-11 21:09:13 +00:00
libutil Don't depend on NULL's expansion being a pointer, cast it before it is passed 2004-05-18 15:53:58 +00:00
libvgl Fix typo. 2004-05-12 20:40:09 +00:00
libwrap
libxpg4
liby
libypclnt Nothing in libypclnt depends on librpcsvc. 2004-02-04 09:53:29 +00:00
libz
msun Remove some kludges designed to ensure that the compiler didn't round 2004-05-17 01:04:37 +00:00
ncurses
Makefile Style fixes: 2004-05-14 19:52:35 +00:00
Makefile.inc