summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_emul.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linux/linux_emul.c')
-rw-r--r--sys/compat/linux/linux_emul.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c
index 116eb11..2a42f70 100644
--- a/sys/compat/linux/linux_emul.c
+++ b/sys/compat/linux/linux_emul.c
@@ -168,19 +168,20 @@ linux_proc_exit(void *arg __unused, struct proc *p)
/* reparent all procs that are not a thread leader to initproc */
if (em->shared->group_pid != p->p_pid) {
- sx_xlock(&proctree_lock);
- wakeup(initproc);
+ child_clear_tid = em->child_clear_tid;
+ EMUL_UNLOCK(&emul_lock);
+ sx_xlock(&proctree_lock);
+ wakeup(initproc);
PROC_LOCK(p);
proc_reparent(p, initproc);
p->p_sigparent = SIGCHLD;
PROC_UNLOCK(p);
- sx_xunlock(&proctree_lock);
+ sx_xunlock(&proctree_lock);
+ } else {
+ child_clear_tid = em->child_clear_tid;
+ EMUL_UNLOCK(&emul_lock);
}
- child_clear_tid = em->child_clear_tid;
-
- EMUL_UNLOCK(&emul_lock);
-
EMUL_SHARED_WLOCK(&emul_shared_lock);
LIST_REMOVE(em, threads);
OpenPOWER on IntegriCloud