Date: Tue, 18 Jan 2000 23:04:52 -0800 (PST) From: Jason Evans <jasone@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libc_r/uthread uthread_jmp.c Makefile.inc pthread_private.h uthread_cancel.c uthread_cond.c uthread_create.c uthread_fd.c uthread_file.c uthread_init.c uthread_join.c uthread_kern.c uthread_mutex.c uthread_priority_queue.c ... Message-ID: <200001190704.XAA84180@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
jasone 2000/01/18 23:04:52 PST
Modified files:
lib/libc_r/uthread Makefile.inc pthread_private.h
uthread_cancel.c uthread_cond.c
uthread_create.c uthread_fd.c
uthread_file.c uthread_init.c
uthread_join.c uthread_kern.c
uthread_mutex.c uthread_priority_queue.c
uthread_setprio.c uthread_sig.c
Added files:
lib/libc_r/uthread uthread_jmp.c
Log:
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
Revision Changes Path
1.21 +2 -1 src/lib/libc_r/uthread/Makefile.inc
1.33 +53 -2 src/lib/libc_r/uthread/pthread_private.h
1.3 +19 -5 src/lib/libc_r/uthread/uthread_cancel.c
1.21 +21 -13 src/lib/libc_r/uthread/uthread_cond.c
1.24 +27 -13 src/lib/libc_r/uthread/uthread_create.c
1.16 +9 -17 src/lib/libc_r/uthread/uthread_fd.c
1.12 +4 -7 src/lib/libc_r/uthread/uthread_file.c
1.23 +13 -1 src/lib/libc_r/uthread/uthread_init.c
1.12 +4 -6 src/lib/libc_r/uthread/uthread_join.c
1.27 +45 -5 src/lib/libc_r/uthread/uthread_kern.c
1.20 +4 -6 src/lib/libc_r/uthread/uthread_mutex.c
1.5 +2 -2 src/lib/libc_r/uthread/uthread_priority_queue.c
1.7 +1 -2 src/lib/libc_r/uthread/uthread_setprio.c
1.24 +196 -18 src/lib/libc_r/uthread/uthread_sig.c
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001190704.XAA84180>
