Date: Wed, 29 Oct 2008 12:11:48 +0000 (UTC) From: David Xu <davidxu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r184438 - head/sys/kern Message-ID: <200810291211.m9TCBmm7022371@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: davidxu Date: Wed Oct 29 12:11:48 2008 New Revision: 184438 URL: http://svn.freebsd.org/changeset/base/184438 Log: If threads limit is exceeded, increase the totoal number of failures. Modified: head/sys/kern/kern_thr.c Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Wed Oct 29 11:03:15 2008 (r184437) +++ head/sys/kern/kern_thr.c Wed Oct 29 12:11:48 2008 (r184438) @@ -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, mcontex 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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810291211.m9TCBmm7022371>