freebsd-nq/lib/libc_r/uthread
Daniel Eischen 4fc937ef8f Change signal handling to conform to POSIX specified semantics.
Before this change, a signal was delivered to each thread that
didn't have the signal masked.  Signals also improperly woke up
threads waiting on I/O.  With this change, signals are now
handled in the following way:

  o If a thread is waiting in a sigwait for the signal,
    then the thread is woken up.

  o If no threads are sigwait'ing on the signal and a
    thread is in a sigsuspend waiting for the signal,
    then the thread is woken up.

  o In the case that no threads are waiting or suspended
    on the signal, then the signal is delivered to the
    first thread we find that has the signal unmasked.

  o If no threads are waiting or suspended on the signal,
    and no threads have the signal unmasked, then the signal
    is added to the process wide pending signal set.  The
    signal will be delivered to the first thread that unmasks
    the signal.

If there is an installed signal handler, it is only invoked
if the chosen thread was not in a sigwait.

In the case that multiple threads are waiting or suspended
on a signal, or multiple threads have the signal unmasked,
we wake up/deliver the signal to the first thread we find.
The above rules still apply.

Reported by:	Scott Hess <scott@avantgo.com>
Reviewed by:	jb, jasone
1999-12-04 22:55:59 +00:00
..
Makefile.inc add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
pthread_private.h Change signal handling to conform to POSIX specified semantics. 1999-12-04 22:55:59 +00:00
uthread_accept.c General clean-up of socket.h and associated sources to synchronise up 1999-11-24 20:49:04 +00:00
uthread_attr_destroy.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_getdetachstate.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_getinheritsched.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_attr_getschedparam.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_attr_getschedpolicy.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_attr_getscope.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_attr_getstackaddr.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_getstacksize.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_init.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_setcreatesuspend_np.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_setdetachstate.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_setinheritsched.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_setprio.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_setschedparam.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_setschedpolicy.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_setscope.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_setstackaddr.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_attr_setstacksize.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_autoinit.cc Fix description of the _thread_autoinit_dummy_decl trick. 1999-08-17 09:50:21 +00:00
uthread_bind.c General clean-up of socket.h and associated sources to synchronise up 1999-11-24 20:49:04 +00:00
uthread_cancel.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_clean.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_close.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_cond.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_condattr_destroy.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_condattr_init.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_connect.c General clean-up of socket.h and associated sources to synchronise up 1999-11-24 20:49:04 +00:00
uthread_create.c * Fix the stack allocation code so that it works for alpha. Change it 1999-11-28 19:47:43 +00:00
uthread_detach.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_dup2.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_dup.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_equal.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_execve.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_exit.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_fchflags.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_fchmod.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_fchown.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_fcntl.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_fd.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_file.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_find_thread.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_flock.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_fork.c Change signal handling to conform to POSIX specified semantics. 1999-12-04 22:55:59 +00:00
uthread_fstat.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_fstatfs.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_fsync.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_gc.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_getdirentries.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_getpeername.c General clean-up of socket.h and associated sources to synchronise up 1999-11-24 20:49:04 +00:00
uthread_getprio.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_getschedparam.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_getsockname.c General clean-up of socket.h and associated sources to synchronise up 1999-11-24 20:49:04 +00:00
uthread_getsockopt.c General clean-up of socket.h and associated sources to synchronise up 1999-11-24 20:49:04 +00:00
uthread_info.c sigset_t change (part 5 of 5) 1999-09-29 15:18:46 +00:00
uthread_init.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_ioctl.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_join.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_kern.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_kill.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_listen.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_mattr_init.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_mattr_kind_np.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_msync.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_multi_np.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_mutex_prioceiling.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_mutex_protocol.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_mutex.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_mutexattr_destroy.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_nanosleep.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_once.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_open.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_pipe.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_poll.c When checking for valid timevals in the wrapped select() and poll() 1999-08-30 00:02:08 +00:00
uthread_priority_queue.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_read.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_readv.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_recvfrom.c General clean-up of socket.h and associated sources to synchronise up 1999-11-24 20:49:04 +00:00
uthread_recvmsg.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_resume_np.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_rwlock.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_rwlockattr.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_select.c When checking for valid timevals in the wrapped select() and poll() 1999-08-30 00:02:08 +00:00
uthread_self.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_sendmsg.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_sendto.c General clean-up of socket.h and associated sources to synchronise up 1999-11-24 20:49:04 +00:00
uthread_seterrno.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_setprio.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_setschedparam.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_setsockopt.c General clean-up of socket.h and associated sources to synchronise up 1999-11-24 20:49:04 +00:00
uthread_shutdown.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_sig.c Change signal handling to conform to POSIX specified semantics. 1999-12-04 22:55:59 +00:00
uthread_sigaction.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_sigblock.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_sigmask.c sigset_t change (part 5 of 5) 1999-09-29 15:18:46 +00:00
uthread_signal.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_sigpending.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_sigprocmask.c sigset_t change (part 5 of 5) 1999-09-29 15:18:46 +00:00
uthread_sigsetmask.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_sigsuspend.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_sigwait.c Change signal handling to conform to POSIX specified semantics. 1999-12-04 22:55:59 +00:00
uthread_single_np.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_socket.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_socketpair.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_spec.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_spinlock.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_suspend_np.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_switch_np.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_vfork.c In libc_r, rename vfork syscall to _thread_sys_vfork and make vfork an alias 1998-09-12 22:03:20 +00:00
uthread_wait4.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_write.c add pthread_cancel, obtained from OpenBSD. 1999-11-28 05:38:13 +00:00
uthread_writev.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
uthread_yield.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00