Fix lock order reversal problem.

This commit is contained in:
davidxu 2003-04-21 14:42:04 +00:00
parent 74f3b325d4
commit 9b48f7bf48
3 changed files with 4 additions and 8 deletions

View File

@ -137,9 +137,7 @@ exit1(struct thread *td, int rv)
* First check if some other thread got here before us..
* if so, act apropriatly, (exit or suspend);
*/
DROP_GIANT();
thread_suspend_check(0);
PICKUP_GIANT();
/*
* Kill off the other threads. This requires

View File

@ -1867,13 +1867,12 @@ thread_single(int force_exit)
* In the mean time we suspend as well.
*/
thread_suspend_one(td);
/* XXX If you recursed this is broken. */
mtx_unlock(&Giant);
DROP_GIANT();
PROC_UNLOCK(p);
p->p_stats->p_ru.ru_nvcsw++;
mi_switch();
mtx_unlock_spin(&sched_lock);
mtx_lock(&Giant);
PICKUP_GIANT();
PROC_LOCK(p);
}
if (force_exit == SINGLE_EXIT) {

View File

@ -1867,13 +1867,12 @@ thread_single(int force_exit)
* In the mean time we suspend as well.
*/
thread_suspend_one(td);
/* XXX If you recursed this is broken. */
mtx_unlock(&Giant);
DROP_GIANT();
PROC_UNLOCK(p);
p->p_stats->p_ru.ru_nvcsw++;
mi_switch();
mtx_unlock_spin(&sched_lock);
mtx_lock(&Giant);
PICKUP_GIANT();
PROC_LOCK(p);
}
if (force_exit == SINGLE_EXIT) {