exit: get rid of PROC_SLOCK when checking a process to report
All accessed fields are protected with already held process lock.
This commit is contained in:
parent
af4010be77
commit
9c0e785c58
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329448
@ -1228,15 +1228,11 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status,
|
|||||||
nfound++;
|
nfound++;
|
||||||
PROC_LOCK_ASSERT(p, MA_OWNED);
|
PROC_LOCK_ASSERT(p, MA_OWNED);
|
||||||
|
|
||||||
if ((options & (WTRAPPED | WUNTRACED)) != 0)
|
|
||||||
PROC_SLOCK(p);
|
|
||||||
|
|
||||||
if ((options & WTRAPPED) != 0 &&
|
if ((options & WTRAPPED) != 0 &&
|
||||||
(p->p_flag & P_TRACED) != 0 &&
|
(p->p_flag & P_TRACED) != 0 &&
|
||||||
(p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 &&
|
(p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 &&
|
||||||
p->p_suspcount == p->p_numthreads &&
|
p->p_suspcount == p->p_numthreads &&
|
||||||
(p->p_flag & P_WAITED) == 0) {
|
(p->p_flag & P_WAITED) == 0) {
|
||||||
PROC_SUNLOCK(p);
|
|
||||||
CTR4(KTR_PTRACE,
|
CTR4(KTR_PTRACE,
|
||||||
"wait: returning trapped pid %d status %#x "
|
"wait: returning trapped pid %d status %#x "
|
||||||
"(xstat %d) xthread %d",
|
"(xstat %d) xthread %d",
|
||||||
@ -1251,13 +1247,10 @@ kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status,
|
|||||||
(p->p_flag & P_STOPPED_SIG) != 0 &&
|
(p->p_flag & P_STOPPED_SIG) != 0 &&
|
||||||
p->p_suspcount == p->p_numthreads &&
|
p->p_suspcount == p->p_numthreads &&
|
||||||
(p->p_flag & P_WAITED) == 0) {
|
(p->p_flag & P_WAITED) == 0) {
|
||||||
PROC_SUNLOCK(p);
|
|
||||||
report_alive_proc(td, p, siginfo, status, options,
|
report_alive_proc(td, p, siginfo, status, options,
|
||||||
CLD_STOPPED);
|
CLD_STOPPED);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if ((options & (WTRAPPED | WUNTRACED)) != 0)
|
|
||||||
PROC_SUNLOCK(p);
|
|
||||||
if ((options & WCONTINUED) != 0 &&
|
if ((options & WCONTINUED) != 0 &&
|
||||||
(p->p_flag & P_CONTINUED) != 0) {
|
(p->p_flag & P_CONTINUED) != 0) {
|
||||||
report_alive_proc(td, p, siginfo, status, options,
|
report_alive_proc(td, p, siginfo, status, options,
|
||||||
|
Loading…
Reference in New Issue
Block a user