* 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. */
| 4529 | * destroyed right now. |
| 4530 | */ |
| 4531 | void |
| 4532 | umtx_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. |
no test coverage detected