diff options
author | bde <bde@FreeBSD.org> | 2002-04-04 15:19:41 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2002-04-04 15:19:41 +0000 |
commit | 3b8182ff404d880440c6a41d8b8496f765081777 (patch) | |
tree | fe0f65124fa6da5af3eb9a5b24516923f9f48da8 /sys/kern/kern_sig.c | |
parent | 0de93566db10d6dcabfa9d11c5c20f30047475a8 (diff) | |
download | FreeBSD-src-3b8182ff404d880440c6a41d8b8496f765081777.zip FreeBSD-src-3b8182ff404d880440c6a41d8b8496f765081777.tar.gz |
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().
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 8c75985..bfefd24 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 |