summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-07-25 03:21:35 +0000
committerjulian <julian@FreeBSD.org>2002-07-25 03:21:35 +0000
commit891c9fcb896ad87afa576f252cb60c125f96ac38 (patch)
tree5de8d469e7a64f4443a6a8d2a310ffaf6ebaec70
parenta0af95a081c5d97ff950628a402b98f42af9a715 (diff)
downloadFreeBSD-src-891c9fcb896ad87afa576f252cb60c125f96ac38.zip
FreeBSD-src-891c9fcb896ad87afa576f252cb60c125f96ac38.tar.gz
get suspension counting right.
fix an error message Submitted by: David Xu <bsddiy@yahoo.com>
-rw-r--r--sys/kern/kern_kse.c4
-rw-r--r--sys/kern/kern_thread.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index c9feadb..23f039a 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -615,6 +615,7 @@ thread_single(int force_exit)
mtx_lock_spin(&sched_lock);
TAILQ_REMOVE(&p->p_suspended,
td, td_runq);
+ p->p_suspcount--;
setrunqueue(td); /* Should suicide. */
mtx_unlock_spin(&sched_lock);
}
@@ -625,6 +626,8 @@ thread_single(int force_exit)
abortsleep(td2);
break;
/* case TDS RUNNABLE: XXXKSE maybe raise priority? */
+ default: /* needed to avoid an error */
+ break;
}
}
/*
@@ -738,6 +741,7 @@ thread_suspend_check(int return_instead)
if (p->p_numthreads == p->p_suspcount) {
TAILQ_REMOVE(&p->p_suspended,
p->p_singlethread, td_runq);
+ p->p_suspcount--;
setrunqueue(p->p_singlethread);
}
}
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index c9feadb..23f039a 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -615,6 +615,7 @@ thread_single(int force_exit)
mtx_lock_spin(&sched_lock);
TAILQ_REMOVE(&p->p_suspended,
td, td_runq);
+ p->p_suspcount--;
setrunqueue(td); /* Should suicide. */
mtx_unlock_spin(&sched_lock);
}
@@ -625,6 +626,8 @@ thread_single(int force_exit)
abortsleep(td2);
break;
/* case TDS RUNNABLE: XXXKSE maybe raise priority? */
+ default: /* needed to avoid an error */
+ break;
}
}
/*
@@ -738,6 +741,7 @@ thread_suspend_check(int return_instead)
if (p->p_numthreads == p->p_suspcount) {
TAILQ_REMOVE(&p->p_suspended,
p->p_singlethread, td_runq);
+ p->p_suspcount--;
setrunqueue(p->p_singlethread);
}
}
OpenPOWER on IntegriCloud