Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_proc.c
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | proc_ctor(void *mem, int size, void *arg, int flags) | ||||
struct thread *td; | struct thread *td; | ||||
p = (struct proc *)mem; | p = (struct proc *)mem; | ||||
EVENTHANDLER_DIRECT_INVOKE(process_ctor, p); | EVENTHANDLER_DIRECT_INVOKE(process_ctor, p); | ||||
td = FIRST_THREAD_IN_PROC(p); | td = FIRST_THREAD_IN_PROC(p); | ||||
if (td != NULL) { | if (td != NULL) { | ||||
/* Make sure all thread constructors are executed */ | /* Make sure all thread constructors are executed */ | ||||
EVENTHANDLER_DIRECT_INVOKE(thread_ctor, td); | EVENTHANDLER_DIRECT_INVOKE(thread_ctor, td); | ||||
STATIC_EVENTHANDLER_INVOKE(thread_ctor, td); | |||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Reclaim a proc after use. | * Reclaim a proc after use. | ||||
*/ | */ | ||||
static void | static void | ||||
Show All 13 Lines | |||||
#endif | #endif | ||||
/* Free all OSD associated to this thread. */ | /* Free all OSD associated to this thread. */ | ||||
osd_thread_exit(td); | osd_thread_exit(td); | ||||
td_softdep_cleanup(td); | td_softdep_cleanup(td); | ||||
MPASS(td->td_su == NULL); | MPASS(td->td_su == NULL); | ||||
/* Make sure all thread destructors are executed */ | /* Make sure all thread destructors are executed */ | ||||
EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); | EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); | ||||
STATIC_EVENTHANDLER_INVOKE(thread_dtor, td); | |||||
} | } | ||||
EVENTHANDLER_DIRECT_INVOKE(process_dtor, p); | EVENTHANDLER_DIRECT_INVOKE(process_dtor, p); | ||||
if (p->p_ksi != NULL) | if (p->p_ksi != NULL) | ||||
KASSERT(! KSI_ONQ(p->p_ksi), ("SIGCHLD queue")); | KASSERT(! KSI_ONQ(p->p_ksi), ("SIGCHLD queue")); | ||||
} | } | ||||
/* | /* | ||||
* Initialize type-stable parts of a proc (when newly created). | * Initialize type-stable parts of a proc (when newly created). | ||||
▲ Show 20 Lines • Show All 3,171 Lines • Show Last 20 Lines |