diff options
author | jhb <jhb@FreeBSD.org> | 2003-04-18 20:20:00 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-04-18 20:20:00 +0000 |
commit | 8b7a3b47d15df24c762596b1df532e54646f0af9 (patch) | |
tree | 4e218d8ce7a895c200dd2841ed79f026a6d9bb7e /sys/alpha | |
parent | fa6200c9ec3dfd9b8ee4c63dbef523a4e4a3c482 (diff) | |
download | FreeBSD-src-8b7a3b47d15df24c762596b1df532e54646f0af9.zip FreeBSD-src-8b7a3b47d15df24c762596b1df532e54646f0af9.tar.gz |
Use the proc lock to protect p_singlethread and a P_WEXIT test. This
fixes a couple of potential KSE panics on non-i386 arch's that weren't
holding the proc lock when calling thread_exit().
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/alpha/trap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/alpha/alpha/trap.c b/sys/alpha/alpha/trap.c index f52152a..e5975e2 100644 --- a/sys/alpha/alpha/trap.c +++ b/sys/alpha/alpha/trap.c @@ -298,12 +298,13 @@ trap(a0, a1, a2, entry, framep) td->td_frame = framep; if (td->td_ucred != p->p_ucred) cred_update_thread(td); + PROC_LOCK(p); if ((p->p_flag & P_WEXIT) && (p->p_singlethread != td)) { - PROC_LOCK(p); mtx_lock_spin(&sched_lock); thread_exit(); /* NOTREACHED */ } + PROC_UNLOCK(p); } else { sticks = 0; /* XXX bogus -Wuninitialized warning */ KASSERT(cold || td->td_ucred != NULL, |