diff options
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index a49964e..345bc31 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -850,10 +850,11 @@ killpg1(cp, sig, pgid, all) struct pgrp *pgrp; int nfound = 0; - if (all) + if (all) { /* * broadcast */ + lockmgr(&allproc_lock, LK_SHARED, NULL, CURPROC); LIST_FOREACH(p, &allproc, p_list) { if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || p == cp || !CANSIGNAL(cp, p, sig)) @@ -862,7 +863,8 @@ killpg1(cp, sig, pgid, all) if (sig) psignal(p, sig); } - else { + lockmgr(&allproc_lock, LK_RELEASE, NULL, CURPROC); + } else { if (pgid == 0) /* * zero pgid means send to my process group. |