summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2006-09-09 16:55:55 +0000
committernetchild <netchild@FreeBSD.org>2006-09-09 16:55:55 +0000
commitbca838df3374bbcc0da828df47b47281d90d4e60 (patch)
tree13e38564a60dd5f694086ab30a0d3f3d3555f9c6 /sys
parentb5865520e186acd59b849006e7d730957562a55f (diff)
downloadFreeBSD-src-bca838df3374bbcc0da828df47b47281d90d4e60.zip
FreeBSD-src-bca838df3374bbcc0da828df47b47281d90d4e60.tar.gz
- Extend the coverage of PROC_LOCK to cover wakeup(&p->p_emuldata);
- Lock the emuldata in a case when we just created it. Sponsored by: Google SoC 2006 Submitted by: rdivacky Suggested by: jhb
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/linux/linux_emul.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c
index b6b74c6..c1dafbc 100644
--- a/sys/compat/linux/linux_emul.c
+++ b/sys/compat/linux/linux_emul.c
@@ -101,6 +101,7 @@ linux_proc_init(struct thread *td, pid_t child, int flags)
panic("process not found in proc_init\n");
p->p_emuldata = em;
PROC_UNLOCK(p);
+ EMUL_LOCK(&emul_lock);
} else {
/* lookup the old one */
em = em_find(td->td_proc, EMUL_UNLOCKED);
@@ -129,14 +130,15 @@ linux_proc_init(struct thread *td, pid_t child, int flags)
if (child != 0) {
+ EMUL_UNLOCK(&emul_lock);
EMUL_SHARED_WLOCK(&emul_shared_lock);
LIST_INSERT_HEAD(&em->shared->threads, em, threads);
EMUL_SHARED_WUNLOCK(&emul_shared_lock);
p = pfind(child);
- PROC_UNLOCK(p);
/* we might have a sleeping linux_schedtail */
wakeup(&p->p_emuldata);
+ PROC_UNLOCK(p);
} else
EMUL_UNLOCK(&emul_lock);
OpenPOWER on IntegriCloud