summaryrefslogtreecommitdiff
path: root/sys/kern/kern_thread.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2003-04-22 19:47:55 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2003-04-22 19:47:55 +0000
commita6f37ac9d63c037195711ac609dae3d5deb711dd (patch)
tree86736ab0403a305470e891173b3cb475ebe05601 /sys/kern/kern_thread.c
parent7b5e3e1239a7740e3f407a2d8936482aed2f99ac (diff)
Notes
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r--sys/kern/kern_thread.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 6ccb19c528eb..7dc177d51d79 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -1311,7 +1311,7 @@ thread_unlink(struct thread *td)
* Purge a ksegrp resource. When a ksegrp is preparing to
* exit, it calls this function.
*/
-void
+static void
kse_purge_group(struct thread *td)
{
struct ksegrp *kg;
@@ -1336,14 +1336,13 @@ kse_purge_group(struct thread *td)
* exit, it calls kse_purge to release any extra KSE resources in
* the process.
*/
-void
+static void
kse_purge(struct proc *p, struct thread *td)
{
struct ksegrp *kg;
struct kse *ke;
KASSERT(p->p_numthreads == 1, ("bad thread number"));
- mtx_lock_spin(&sched_lock);
while ((kg = TAILQ_FIRST(&p->p_ksegrps)) != NULL) {
TAILQ_REMOVE(&p->p_ksegrps, kg, kg_ksegrp);
p->p_numksegrps--;
@@ -1373,7 +1372,6 @@ kse_purge(struct proc *p, struct thread *td)
}
TAILQ_INSERT_HEAD(&p->p_ksegrps, td->td_ksegrp, kg_ksegrp);
p->p_numksegrps++;
- mtx_unlock_spin(&sched_lock);
}
/*
@@ -1969,12 +1967,12 @@ thread_suspend_check(int return_instead)
* and stays there.
*/
thread_suspend_one(td);
- PROC_UNLOCK(p);
if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) {
if (p->p_numthreads == p->p_suspcount) {
thread_unsuspend_one(p->p_singlethread);
}
}
+ PROC_UNLOCK(p);
p->p_stats->p_ru.ru_nivcsw++;
mi_switch();
mtx_unlock_spin(&sched_lock);