From bfd14a1c597078efd63061dc7b546248a49c8bab Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 22 Jun 2008 08:10:05 +0000 Subject: [PATCH] Make sure all pools have their minimum complement of threads. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2765 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_pool.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index 92daeb45..5891bd8c 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -530,12 +530,19 @@ wrk_breed_flock(struct wq *qp) static void * wrk_herder_thread(void *priv) { - unsigned u; + unsigned u, w; THR_Name("wrk_herder"); (void)priv; while (1) { for (u = 0 ; u < nwq; u++) { + /* + * Make sure all pools have their minimum complement + */ + for (w = 0 ; w < nwq; w++) { + if (wq[w]->nthr < nthr_min) + wrk_breed_flock(wq[w]); + } /* * We cannot avoid getting a mutex, so we have a * bogo mutex just for POSIX_STUPIDITY -- 2.39.5