diff options
| author | christos <christos@NetBSD.org> | 2005-07-26 20:11:02 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2005-07-26 20:11:02 +0000 |
| commit | 9d60b1fc8950575417ca111442e76aef8da7077d (patch) | |
| tree | bbdba1190fe39b5c8e655c925533219bca0af289 /lib/libpthread | |
| parent | f44796a7b7edb3ef6f866768ed8b98d27260eb4e (diff) | |
- removed bogus acts.sa_mask setting.
- unblock the signal we are currently delivering, because it might have
been blocked if we are woken up by another thread.
Diffstat (limited to 'lib/libpthread')
| -rw-r--r-- | lib/libpthread/pthread_sig.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/libpthread/pthread_sig.c b/lib/libpthread/pthread_sig.c index 4396e3e9a27..2a0c69791f1 100644 --- a/lib/libpthread/pthread_sig.c +++ b/lib/libpthread/pthread_sig.c @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_sig.c,v 1.39 2005/02/27 18:25:02 nathanw Exp $ */ +/* $NetBSD: pthread_sig.c,v 1.40 2005/07/26 20:11:02 christos Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: pthread_sig.c,v 1.39 2005/02/27 18:25:02 nathanw Exp $"); +__RCSID("$NetBSD: pthread_sig.c,v 1.40 2005/07/26 20:11:02 christos Exp $"); /* We're interposing a specific version of the signal interface. */ #define __LIBC12_SOURCE__ @@ -771,11 +771,9 @@ pthread__kill_self(pthread_t self, siginfo_t *si) SDPRINTF(("(pthread__kill_self %p) sig %d\n", self, si->si_signo)); oldmask = self->pt_sigmask; - __sigplusset(&act.sa_mask, &self->pt_sigmask); if ((act.sa_flags & SA_NODEFER) == 0) __sigaddset14(&self->pt_sigmask, si->si_signo); - pthread_spinunlock(self, &self->pt_siglock); (*act.sa_sigaction)(si->si_signo, si, &uc); pthread_spinlock(self, &self->pt_siglock); @@ -879,11 +877,18 @@ pthread__deliver_signal(pthread_t self, pthread_t target, siginfo_t *si) olduc = target->pt_uc; /* + * Get the current signal mask, but unblock the current signal, + * because we might have been sigdeferred and the signal would + * have been blocked because of that. Since we are delivering + * the signal now, we cannot have this signal blocked anyway. + * XXX: Is it better to check for SIGDEFERRED here? + */ + olduc->uc_sigmask = target->pt_sigmask; + __sigdelset14(&olduc->uc_sigmask, si->si_signo); + /* * Prevent anyone else from considering this thread for handling * more instances of this signal. */ - olduc->uc_sigmask = target->pt_sigmask; - __sigplusset(&act.sa_mask, &target->pt_sigmask); if ((act.sa_flags & SA_NODEFER) == 0) __sigaddset14(&target->pt_sigmask, si->si_signo); |
