]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use a generic way to back threads out of wait queues when handling
authordeischen <deischen@FreeBSD.org>
Sat, 18 Dec 2004 18:07:37 +0000 (18:07 +0000)
committerdeischen <deischen@FreeBSD.org>
Sat, 18 Dec 2004 18:07:37 +0000 (18:07 +0000)
commita5b13ff571d8e5b6e117756821e8aa5beb7b5d2c
tree3341fdd3fcdb8d611509d7622be5b25f271de80a
parentb231943e0e593788032a55590d7960ae015bddd2
Use a generic way to back threads out of wait queues when handling
signals instead of having more intricate knowledge of thread state
within signal handling.

Simplify signal code because of above (by David Xu).

Use macros for libpthread usage of pthread_cleanup_push() and
pthread_cleanup_pop().  This removes some instances of malloc()
and free() from the semaphore and pthread_once() implementations.

When single threaded and forking(), make sure that the current
thread's signal mask is inherited by the forked thread.

Use private mutexes for libc and libpthread.  Signals are
deferred while threads hold private mutexes.  This fix also
breaks www/linuxpluginwrapper; a patch that fixes it is at
http://people.freebsd.org/~deischen/kse/linuxpluginwrapper.diff

Fix race condition in condition variables where handling a
signal (pthread_kill() or kill()) may not see a wakeup
(pthread_cond_signal() or pthread_cond_broadcast()).

In collaboration with: davidxu
33 files changed:
lib/libkse/sys/thr_error.c
lib/libkse/thread/thr_cancel.c
lib/libkse/thread/thr_clean.c
lib/libkse/thread/thr_concurrency.c
lib/libkse/thread/thr_cond.c
lib/libkse/thread/thr_create.c
lib/libkse/thread/thr_fork.c
lib/libkse/thread/thr_init.c
lib/libkse/thread/thr_kern.c
lib/libkse/thread/thr_mutex.c
lib/libkse/thread/thr_once.c
lib/libkse/thread/thr_private.h
lib/libkse/thread/thr_sem.c
lib/libkse/thread/thr_sig.c
lib/libkse/thread/thr_sigsuspend.c
lib/libkse/thread/thr_spinlock.c
lib/libpthread/pthread.map
lib/libpthread/sys/thr_error.c
lib/libpthread/thread/thr_cancel.c
lib/libpthread/thread/thr_clean.c
lib/libpthread/thread/thr_concurrency.c
lib/libpthread/thread/thr_cond.c
lib/libpthread/thread/thr_create.c
lib/libpthread/thread/thr_fork.c
lib/libpthread/thread/thr_init.c
lib/libpthread/thread/thr_kern.c
lib/libpthread/thread/thr_mutex.c
lib/libpthread/thread/thr_once.c
lib/libpthread/thread/thr_private.h
lib/libpthread/thread/thr_sem.c
lib/libpthread/thread/thr_sig.c
lib/libpthread/thread/thr_sigsuspend.c
lib/libpthread/thread/thr_spinlock.c