summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2008-10-29 12:11:48 +0000
committerdavidxu <davidxu@FreeBSD.org>2008-10-29 12:11:48 +0000
commit11aa09b4886d3d56d390fa4b3163ec8898f8c17d (patch)
treea701cf3213a8bf5033aee181590ea5a545ce1442
parenteeb08e6fced1e618849109005983a9ec530cd210 (diff)
downloadFreeBSD-src-11aa09b4886d3d56d390fa4b3163ec8898f8c17d.zip
FreeBSD-src-11aa09b4886d3d56d390fa4b3163ec8898f8c17d.tar.gz
If threads limit is exceeded, increase the totoal number
of failures.
-rw-r--r--sys/kern/kern_thr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index 51f0f05..75d6d01 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -76,6 +76,7 @@ suword_lwpid(void *addr, lwpid_t lwpid)
#endif
extern int max_threads_per_proc;
+extern int max_threads_hits;
static int create_thread(struct thread *td, mcontext_t *ctx,
void (*start_func)(void *), void *arg,
@@ -154,8 +155,10 @@ create_thread(struct thread *td, mcontext_t *ctx,
p = td->td_proc;
/* Have race condition but it is cheap. */
- if (p->p_numthreads >= max_threads_per_proc)
+ if (p->p_numthreads >= max_threads_per_proc) {
+ ++max_threads_hits;
return (EPROCLIM);
+ }
if (rtp != NULL) {
switch(rtp->type) {
OpenPOWER on IntegriCloud