1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-19 15:33:56 +00:00

Fix lock order reversal problem.

This commit is contained in:
David Xu 2003-04-21 14:42:04 +00:00
parent d3fc864f93
commit 11b20c685b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113795
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) {