aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_trap.c
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2003-02-17 09:58:11 +0000
committerJeff Roberson <jeff@FreeBSD.org>2003-02-17 09:58:11 +0000
commit58a3c27384e79f4a71995252fd590f2a6aea4d1f (patch)
tree4c53a750b6910eb1a28edeff1a48bdd7ef932736 /sys/kern/subr_trap.c
parent4a338afd7a9034a944764eee1adb7b6f7668258c (diff)
downloadsrc-58a3c27384e79f4a71995252fd590f2a6aea4d1f.tar.gz
src-58a3c27384e79f4a71995252fd590f2a6aea4d1f.zip
- 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
Notes
Notes: svn path=/head/; revision=111033
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 7ffb9682f912..c0c0fd58de6a 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);