diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 6b33a5b63181..366831c3f096 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef KTRACE @@ -1047,8 +1048,8 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) imgp->sysent = sv; sigfastblock_clear(td); + umtx_exec(p); - /* May be called with Giant held */ EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp); /* diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index acff69474302..466328dc9840 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -446,8 +446,6 @@ umtxq_sysinit(void *arg __unused) umtx_init_profiling(); #endif mtx_init(&umtx_lock, "umtx lock", NULL, MTX_DEF); - EVENTHANDLER_REGISTER(process_exec, umtx_exec_hook, NULL, - EVENTHANDLER_PRI_ANY); umtx_shm_init(); } @@ -4356,12 +4354,11 @@ umtx_thread_alloc(struct thread *td) * exec() hook. * * Clear robust lists for all process' threads, not delaying the - * cleanup to thread_exit hook, since the relevant address space is + * cleanup to thread exit, since the relevant address space is * destroyed right now. */ -static void -umtx_exec_hook(void *arg __unused, struct proc *p, - struct image_params *imgp __unused) +void +umtx_exec(struct proc *p) { struct thread *td; @@ -4383,7 +4380,7 @@ umtx_exec_hook(void *arg __unused, struct proc *p, } /* - * thread_exit() hook. + * thread exit hook. */ void umtx_thread_exit(struct thread *td) diff --git a/sys/sys/umtx.h b/sys/sys/umtx.h index da93d03f9329..2955c2ad9901 100644 --- a/sys/sys/umtx.h +++ b/sys/sys/umtx.h @@ -188,6 +188,7 @@ umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2) } int umtx_copyin_timeout(const void *, struct timespec *); +void umtx_exec(struct proc *p); int umtx_key_get(const void *, int, int, struct umtx_key *); void umtx_key_release(struct umtx_key *); struct umtx_q *umtxq_alloc(void);