summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_exit.c2
-rw-r--r--sys/kern/kern_kse.c5
-rw-r--r--sys/kern/kern_thread.c5
3 files changed, 4 insertions, 8 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 0339bb613c3e..187364b72ab0 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -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
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 18c097f1f936..6ccb19c528eb 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -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) {
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 18c097f1f936..6ccb19c528eb 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -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) {