Fix lock order reversal problem.
This commit is contained in:
parent
74f3b325d4
commit
9b48f7bf48
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user