aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_thr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_thr.c')
-rw-r--r--sys/kern/kern_thr.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index 399d4d8b869e..f3e4e3649855 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -353,14 +353,13 @@ kern_thr_exit(struct thread *td)
return (0);
}
- p->p_pendingexits++;
td->td_dbgflags |= TDB_EXIT;
- if (p->p_ptevents & PTRACE_LWP)
+ if (p->p_ptevents & PTRACE_LWP) {
+ p->p_pendingexits++;
ptracestop(td, SIGTRAP, NULL);
- PROC_UNLOCK(p);
+ p->p_pendingexits--;
+ }
tidhash_remove(td);
- PROC_LOCK(p);
- p->p_pendingexits--;
/*
* The check above should prevent all other threads from this