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

Function umtx_exec

freebsd/kern/kern_umtx.c:4531–4551  ·  view source on GitHub ↗

* exec() hook. * * Clear robust lists for all process' threads, not delaying the * cleanup to thread exit, since the relevant address space is * destroyed right now. */

Source from the content-addressed store, hash-verified

4529 * destroyed right now.
4530 */
4531void
4532umtx_exec(struct proc *p)
4533{
4534 struct thread *td;
4535
4536 KASSERT(p == curproc, ("need curproc"));
4537 KASSERT((p->p_flag & P_HADTHREADS) == 0 ||
4538 (p->p_flag & P_STOPPED_SINGLE) != 0,
4539 ("curproc must be single-threaded"));
4540 /*
4541 * There is no need to lock the list as only this thread can be
4542 * running.
4543 */
4544 FOREACH_THREAD_IN_PROC(p, td) {
4545 KASSERT(td == curthread ||
4546 ((td->td_flags & TDF_BOUNDARY) != 0 && TD_IS_SUSPENDED(td)),
4547 ("running thread %p %p", p, td));
4548 umtx_thread_cleanup(td);
4549 td->td_rb_list = td->td_rbp_list = td->td_rb_inact = 0;
4550 }
4551}
4552
4553/*
4554 * thread exit hook.

Callers 1

exec_new_vmspaceFunction · 0.85

Calls 1

umtx_thread_cleanupFunction · 0.85

Tested by

no test coverage detected