diff options
author | jhb <jhb@FreeBSD.org> | 2013-03-18 17:23:58 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2013-03-18 17:23:58 +0000 |
commit | 8b099870ed9610eb7624539e21eda50303937968 (patch) | |
tree | bc3da40472cd5518cd47bfef78827d9214361be6 /sys/kern/kern_sig.c | |
parent | 5f339017dc07b801ac6a4adcf667eb4fdcb0d408 (diff) | |
download | FreeBSD-src-8b099870ed9610eb7624539e21eda50303937968.zip FreeBSD-src-8b099870ed9610eb7624539e21eda50303937968.tar.gz |
Partially revert r195702. Deferring stops is now implemented via a set of
calls to toggle TDF_SBDRY rather than passing PBDRY to individual sleep
calls.
- Remove the stop_allowed parameters from cursig() and issignal().
issignal() checks TDF_SBDRY directly.
- Remove the PBDRY and SLEEPQ_STOP_ON_BDRY flags.
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index e1dbedc..51d1b18 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -108,7 +108,7 @@ SDT_PROBE_ARGTYPE(proc, kernel, , signal_discard, 2, "int"); static int coredump(struct thread *); static int killpg1(struct thread *td, int sig, int pgid, int all, ksiginfo_t *ksi); -static int issignal(struct thread *td, int stop_allowed); +static int issignal(struct thread *td); static int sigprop(int sig); static void tdsigwakeup(struct thread *, int, sig_t, int); static void sig_suspend_threads(struct thread *, struct proc *, int); @@ -565,14 +565,12 @@ sigqueue_delete_stopmask_proc(struct proc *p) * action, the process stops in issignal(). */ int -cursig(struct thread *td, int stop_allowed) +cursig(struct thread *td) { PROC_LOCK_ASSERT(td->td_proc, MA_OWNED); - KASSERT(stop_allowed == SIG_STOP_ALLOWED || - stop_allowed == SIG_STOP_NOT_ALLOWED, ("cursig: stop_allowed")); mtx_assert(&td->td_proc->p_sigacts->ps_mtx, MA_OWNED); THREAD_LOCK_ASSERT(td, MA_NOTOWNED); - return (SIGPENDING(td) ? issignal(td, stop_allowed) : 0); + return (SIGPENDING(td) ? issignal(td) : 0); } /* @@ -1202,7 +1200,7 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, SIGSETNAND(td->td_sigmask, waitset); for (;;) { mtx_lock(&ps->ps_mtx); - sig = cursig(td, SIG_STOP_ALLOWED); + sig = cursig(td); mtx_unlock(&ps->ps_mtx); if (sig != 0 && SIGISMEMBER(waitset, sig)) { if (sigqueue_get(&td->td_sigqueue, sig, ksi) != 0 || @@ -1465,7 +1463,7 @@ kern_sigsuspend(struct thread *td, sigset_t mask) /* void */; thread_suspend_check(0); mtx_lock(&p->p_sigacts->ps_mtx); - while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0) + while ((sig = cursig(td)) != 0) has_sig += postsig(sig); mtx_unlock(&p->p_sigacts->ps_mtx); } @@ -2399,12 +2397,10 @@ static void sig_suspend_threads(struct thread *td, struct proc *p, int sending) { struct thread *td2; - int wakeup_swapper; PROC_LOCK_ASSERT(p, MA_OWNED); PROC_SLOCK_ASSERT(p, MA_OWNED); - wakeup_swapper = 0; FOREACH_THREAD_IN_PROC(p, td2) { thread_lock(td2); td2->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; @@ -2431,8 +2427,6 @@ sig_suspend_threads(struct thread *td, struct proc *p, int sending) } thread_unlock(td2); } - if (wakeup_swapper) - kick_proc0(); } int @@ -2584,7 +2578,7 @@ sigallowstop() * postsig(sig); */ static int -issignal(struct thread *td, int stop_allowed) +issignal(struct thread *td) { struct proc *p; struct sigacts *ps; |