summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_trap.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-02-17 09:58:11 +0000
committerjeff <jeff@FreeBSD.org>2003-02-17 09:58:11 +0000
commit5c29a640b86af6a1bd38d6186b82cba5e9c21065 (patch)
tree4c53a750b6910eb1a28edeff1a48bdd7ef932736 /sys/kern/subr_trap.c
parentaf55753a063a04a847a53c2946cd5fbf413a1e0f (diff)
downloadFreeBSD-src-5c29a640b86af6a1bd38d6186b82cba5e9c21065.zip
FreeBSD-src-5c29a640b86af6a1bd38d6186b82cba5e9c21065.tar.gz
- Add a new function, thread_signal_add(), that is called from postsig to
add a signal to a mailbox's pending set. - Add a new function, thread_signal_upcall(), this causes the current thread to upcall so that we can deliver pending signals. Reviewed by: mini
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r--sys/kern/subr_trap.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 7ffb968..c0c0fd5 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -247,10 +247,17 @@ ast(struct trapframe *framep)
mtx_unlock_spin(&sched_lock);
}
if (sflag & PS_NEEDSIGCHK) {
+ int sigs;
+
+ sigs = 0;
PROC_LOCK(p);
- while ((sig = cursig(td)) != 0)
+ while ((sig = cursig(td)) != 0) {
postsig(sig);
+ sigs++;
+ }
PROC_UNLOCK(p);
+ if (p->p_flag & P_KSES && sigs)
+ thread_signal_upcall(td);
}
userret(td, framep, sticks);
OpenPOWER on IntegriCloud