diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-01-08 22:44:54 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-01-08 22:44:54 +0000 |
commit | befa7a41a2066d28b744f83557cdec32fe3fe9f2 (patch) | |
tree | abc18c56335163ce077038490574df6710ea1a91 /sys/kern/kern_sig.c | |
parent | 142640c5deafc861062095c3a0e91148d11b0a17 (diff) | |
download | FreeBSD-src-befa7a41a2066d28b744f83557cdec32fe3fe9f2.zip FreeBSD-src-befa7a41a2066d28b744f83557cdec32fe3fe9f2.tar.gz |
Drop the sigacts mutex around calls to stopevent() to avoid sleeping
holding the mutex. Because the sigacts pointer can't change while
the process is "live" (proc locking (x)), we know our pointer is still
valid.
In communication with: truckman
Reviewed by: jhb
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 7ad7dcc..bf822d1 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2080,7 +2080,11 @@ issignal(td) return (0); sig = sig_ffs(&sigpending); - _STOPEVENT(p, S_SIG, sig); + if (p->p_stops & S_SIG) { + mtx_unlock(&ps->ps_mtx); + stopevent(p, S_SIG, sig); + mtx_lock(&ps->ps_mtx); + } /* * We should see pending but ignored signals @@ -2296,7 +2300,11 @@ postsig(sig) ktrpsig(sig, action, td->td_pflags & TDP_OLDMASK ? &td->td_oldsigmask : &td->td_sigmask, 0); #endif - _STOPEVENT(p, S_SIG, sig); + if (p->p_stops & S_SIG) { + mtx_unlock(&ps->ps_mtx); + stopevent(p, S_SIG, sig); + mtx_lock(&ps->ps_mtx); + } if (!(td->td_flags & TDF_SA && td->td_mailbox) && action == SIG_DFL) { |