freebsd-dev/lib/libc_r
Jason Evans 0a3fa43c7e Implement continuations to correctly handle [sig|_]longjmp() inside of a
signal handler.  Explicitly check for jumps to anywhere other than the
current stack, since such jumps are undefined according to POSIX.

While we're at it, convert thread cancellation to use continuations, since
it's cleaner than the original cancellation code.

Avoid delivering a signal to a thread twice.  This was a pre-existing bug,
but was likely unexposed until these other changes were made.

Defer signals generated by pthread_kill() so that they can be delivered on
the appropriate stack.  deischen claims that this is unnecessary, which is
likely true, but without this change, pthread_kill() can cause undefined
priority queue states and/or PANICs in [sig|_]longjmp(), so I'm leaving
this in for now.  To compile this code out and exercise the bug, define
the _NO_UNDISPATCH cpp macro.  Defining _PTHREADS_INVARIANTS as well will
cause earlier crashes.

PR:			kern/14685
Collaboration with:	deischen
2000-01-19 07:04:50 +00:00
..
arch $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
man Fixed bitrot in synopsis. The change from "int *pshared" to "int pshared" 1999-12-23 16:51:27 +00:00
sys $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
test Change to work with recent signal changes. The signal being handled is 1999-12-17 11:46:55 +00:00
uthread Implement continuations to correctly handle [sig|_]longjmp() inside of a 2000-01-19 07:04:50 +00:00
Makefile Fix some minor POSIX/SUSv2 compliance nits. 1999-12-18 01:00:42 +00:00