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/ia64 | |
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/ia64')
-rw-r--r-- | sys/ia64/ia64/trap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c index 3fdf9a6..0e86100 100644 --- a/sys/ia64/ia64/trap.c +++ b/sys/ia64/ia64/trap.c @@ -334,11 +334,13 @@ trap(int vector, int imm, struct trapframe *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)) { mtx_lock_spin(&sched_lock); - thread_exit(); /* XXXKSE need proc lock? */ + thread_exit(); /* NOTREACHED */ } + PROC_UNLOCK(p); } else { sticks = 0; /* XXX bogus -Wuninitialized warning */ KASSERT(cold || td->td_ucred != NULL, |