Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/kern_thr.c
Show First 20 Lines • Show All 350 Lines • ▼ Show 20 Lines | if (p->p_numthreads == p->p_pendingexits + 1) { | ||||
*/ | */ | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
return (0); | return (0); | ||||
} | } | ||||
p->p_pendingexits++; | p->p_pendingexits++; | ||||
td->td_dbgflags |= TDB_EXIT; | td->td_dbgflags |= TDB_EXIT; | ||||
if (p->p_ptevents & PTRACE_LWP) | if (p->p_ptevents & PTRACE_LWP) | ||||
ptracestop(td, SIGTRAP); | ptracestop(td, SIGTRAP, NULL); | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
tidhash_remove(td); | tidhash_remove(td); | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
p->p_pendingexits--; | p->p_pendingexits--; | ||||
/* | /* | ||||
* The check above should prevent all other threads from this | * The check above should prevent all other threads from this | ||||
* process from exiting while the PROC_LOCK is dropped, so | * process from exiting while the PROC_LOCK is dropped, so | ||||
▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines |