summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_kse.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-05-01 07:29:25 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-05-01 07:29:25 +0000
commita8c00fe70be62dae87b846d525773f88b53a65df (patch)
tree83c6ea1aec4bf55bf940670077947c4b00afe7a2 /sys/kern/kern_kse.c
parent2d8975b7db20106811c815c09eb7ef33fe3f68fa (diff)
downloadFreeBSD-src-a8c00fe70be62dae87b846d525773f88b53a65df.zip
FreeBSD-src-a8c00fe70be62dae87b846d525773f88b53a65df.tar.gz
Drop Giant lock before suspended, pick up it after resumed.
thread_suspend_check() is used in exit1() which still needs Giant lock.
Diffstat (limited to 'sys/kern/kern_kse.c')
-rw-r--r--sys/kern/kern_kse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 4a3e92e..b2e842b 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -1165,6 +1165,9 @@ thread_exit(void)
td->td_standin = NULL;
}
+ if (p->p_tracee == td)
+ p->p_tracee = 0;
+
cpu_thread_exit(td); /* XXXSMP */
/*
@@ -1945,7 +1948,6 @@ thread_suspend_check(int return_instead)
thr_exit1();
}
- mtx_assert(&Giant, MA_NOTOWNED);
/*
* When a thread suspends, it just
* moves to the processes's suspend queue
@@ -1957,10 +1959,12 @@ thread_suspend_check(int return_instead)
thread_unsuspend_one(p->p_singlethread);
}
}
+ DROP_GIANT();
PROC_UNLOCK(p);
p->p_stats->p_ru.ru_nivcsw++;
mi_switch();
mtx_unlock_spin(&sched_lock);
+ PICKUP_GIANT();
PROC_LOCK(p);
}
return (0);
OpenPOWER on IntegriCloud