From 4a027d50c7f3f30178a89b3159ba9e4b44f06885 Mon Sep 17 00:00:00 2001 From: John Birrell Date: Wed, 29 Apr 1998 09:59:34 +0000 Subject: Change signal model to match POSIX (i.e. one set of signal handlers for the process, not a separate set for each thread). By default, the process now only has signal handlers installed for SIGVTALRM, SIGINFO and SIGCHLD. The thread kernel signal handler is installed for other signals on demand. This means that SIG_IGN and SIG_DFL processing is now left to the kernel, not the thread kernel. Change the signal dispatch to no longer use a signal thread, and call the signal handler using the stack of the thread that has the signal pending. Change the atomic lock method to use test-and-set asm code with a yield if blocked. This introduces separate locks for each type of object instead of blocking signals to prevent a context switch. It was this blocking of signals that caused the performance degradation the people have noted. This is a *big* change! --- lib/libpthread/thread/thr_sigwait.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'lib/libpthread/thread/thr_sigwait.c') diff --git a/lib/libpthread/thread/thr_sigwait.c b/lib/libpthread/thread/thr_sigwait.c index 4f95190e4216..63c7093f7c34 100644 --- a/lib/libpthread/thread/thr_sigwait.c +++ b/lib/libpthread/thread/thr_sigwait.c @@ -43,9 +43,6 @@ sigwait(const sigset_t * set, int *sig) int status; sigset_t oset; - /* Block signals: */ - _thread_kern_sig_block(&status); - /* Save the current sigmal mask: */ oset = _thread_run->sigmask; @@ -55,18 +52,12 @@ sigwait(const sigset_t * set, int *sig) /* Wait for a signal: */ _thread_kern_sched_state(PS_SIGWAIT, __FILE__, __LINE__); - /* Block signals again: */ - _thread_kern_sig_block(NULL); - /* Return the signal number to the caller: */ *sig = _thread_run->signo; /* Restore the signal mask: */ _thread_run->sigmask = oset; - /* Unblock signals: */ - _thread_kern_sig_unblock(status); - /* Return the completion status: */ return (ret); } -- cgit v1.2.3