]> err.no Git - varnish/commitdiff
Make sure all pools have their minimum complement of threads.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 22 Jun 2008 08:10:05 +0000 (08:10 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 22 Jun 2008 08:10:05 +0000 (08:10 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2765 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_pool.c

index 92daeb45423d1a076ba8a9b5f6ef17a5dadff32e..5891bd8c5bfd86a863f399d8d7f7979c0529b21c 100644 (file)
@@ -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