Fix reverse ordering of locks. add a comment about locks on some platforms.

Submitted by:	jhb@freebsd.org
This commit is contained in:
Julian Elischer 2002-06-29 23:58:50 +00:00
parent 5cdd3a031f
commit 8540497c50
5 changed files with 5 additions and 5 deletions

View file

@ -301,8 +301,8 @@ trap(a0, a1, a2, entry, framep)
if (td->td_ucred != p->p_ucred)
cred_update_thread(td);
if ((p->p_flag & P_WEXIT) && (p->p_singlethread != td)) {
mtx_lock_spin(&sched_lock);
PROC_LOCK(p);
mtx_lock_spin(&sched_lock);
thread_exit();
/* NOTREACHED */
}

View file

@ -273,8 +273,8 @@ trap(frame)
* But check if we are the single thread first!
*/
if ((p->p_flag & P_WEXIT) && (p->p_singlethread != td)) {
PROC_LOCK(p); /* check if thisis really needed */
mtx_lock_spin(&sched_lock);
PROC_LOCK(p);
thread_exit();
/* NOTREACHED */
}

View file

@ -273,8 +273,8 @@ trap(frame)
* But check if we are the single thread first!
*/
if ((p->p_flag & P_WEXIT) && (p->p_singlethread != td)) {
PROC_LOCK(p); /* check if thisis really needed */
mtx_lock_spin(&sched_lock);
PROC_LOCK(p);
thread_exit();
/* NOTREACHED */
}

View file

@ -337,7 +337,7 @@ trap(int vector, int imm, struct trapframe *framep)
cred_update_thread(td);
if ((p->p_flag & P_WEXIT) && (p->p_singlethread != td)) {
mtx_lock_spin(&sched_lock);
thread_exit();
thread_exit(); /* XXXKSE need proc lock? */
/* NOTREACHED */
}
} else {

View file

@ -193,7 +193,7 @@ trap(struct trapframe *tf)
cred_update_thread(td);
if ((p->p_flag & P_WEXIT) && (p->p_singlethread != td)) {
mtx_lock_spin(&sched_lock);
thread_exit();
thread_exit(); /* XXXKSE need proc lock? */
/* NOTREACHED */
}
} else {