MCPcopy Create free account
hub / github.com/F-Stack/f-stack / childproc_jobstate

Function childproc_jobstate

freebsd/kern/kern_sig.c:3343–3367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3341}
3342
3343static void
3344childproc_jobstate(struct proc *p, int reason, int sig)
3345{
3346 struct sigacts *ps;
3347
3348 PROC_LOCK_ASSERT(p, MA_OWNED);
3349 PROC_LOCK_ASSERT(p->p_pptr, MA_OWNED);
3350
3351 /*
3352 * Wake up parent sleeping in kern_wait(), also send
3353 * SIGCHLD to parent, but SIGCHLD does not guarantee
3354 * that parent will awake, because parent may masked
3355 * the signal.
3356 */
3357 p->p_pptr->p_flag |= P_STATCHILD;
3358 wakeup(p->p_pptr);
3359
3360 ps = p->p_pptr->p_sigacts;
3361 mtx_lock(&ps->ps_mtx);
3362 if ((ps->ps_flag & PS_NOCLDSTOP) == 0) {
3363 mtx_unlock(&ps->ps_mtx);
3364 sigparent(p, reason, sig);
3365 } else
3366 mtx_unlock(&ps->ps_mtx);
3367}
3368
3369void
3370childproc_stopped(struct proc *p, int reason)

Callers 2

childproc_stoppedFunction · 0.85
childproc_continuedFunction · 0.85

Calls 4

sigparentFunction · 0.85
wakeupFunction · 0.70
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected