aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2002-04-04 15:19:41 +0000
committerBruce Evans <bde@FreeBSD.org>2002-04-04 15:19:41 +0000
commit179235b38b56f8006e208d42bcff09a0393191b7 (patch)
treefe0f65124fa6da5af3eb9a5b24516923f9f48da8 /sys/kern/kern_sig.c
parent55d884db3888c9ec901d8a9128f18e9a857add2a (diff)
downloadsrc-179235b38b56f8006e208d42bcff09a0393191b7.tar.gz
src-179235b38b56f8006e208d42bcff09a0393191b7.zip
Optimized the check for unmasked pending signals in CURSIG() using a new
inline function sigsetmasked() and a new macro SIGPENDING(). CURSIG() will soon be moved out of the normal path of execution for syscalls and traps. Then its efficiency will be less important but the new interfaces will be useful for checking for unmasked pending signals in more places. Submitted by: luoqi (long ago, in a slightly different form) Assert that sched_lock is not held in CURSIG().
Notes
Notes: svn path=/head/; revision=93786
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 8c75985043a0..bfefd2460def 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -174,16 +174,10 @@ static int sigproptbl[NSIG] = {
int
CURSIG(struct proc *p)
{
- sigset_t tmpset;
PROC_LOCK_ASSERT(p, MA_OWNED);
- if (SIGISEMPTY(p->p_siglist))
- return (0);
- tmpset = p->p_siglist;
- SIGSETNAND(tmpset, p->p_sigmask);
- if (SIGISEMPTY(tmpset) && (p->p_flag & P_TRACED) == 0)
- return (0);
- return (issignal(p));
+ mtx_assert(&sched_lock, MA_NOTOWNED);
+ return (SIGPENDING(p) ? issignal(p) : 0);
}
static __inline int