From: phk Date: Mon, 18 Sep 2006 09:57:25 +0000 (+0000) Subject: eliminate redundant counter. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8833cf2ebf883947231c74106f340cc81ee6ed4;p=varnish eliminate redundant counter. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1068 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index 1a01d0fd..89efd352 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -37,7 +37,6 @@ struct wq { MTX mtx; struct workerhead idle; TAILQ_HEAD(, workreq) req; - unsigned overflow; unsigned nwrk; }; @@ -197,15 +196,15 @@ wrk_thread(void *priv) CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); /* Process overflow requests, if any */ - if (qp->overflow > 0) { - qp->overflow--; + for(;;) { w->wrq = TAILQ_FIRST(&qp->req); + if (w->wrq == NULL) + break; AN(w->wrq); TAILQ_REMOVE(&qp->req, w->wrq, list); UNLOCK(&qp->mtx); wrk_do_one(w); LOCK(&qp->mtx); - continue; } TAILQ_INSERT_HEAD(&qp->idle, w, list); @@ -272,7 +271,6 @@ WRK_QueueSession(struct sess *sp) } TAILQ_INSERT_TAIL(&qp->req, &sp->workreq, list); - qp->overflow++; UNLOCK(&qp->mtx); LOCK(&tmtx);