Mailing List Archive

r1068 - trunk/varnish-cache/bin/varnishd
Author: phk
Date: 2006-09-18 11:57:25 +0200 (Mon, 18 Sep 2006)
New Revision: 1068

Modified:
trunk/varnish-cache/bin/varnishd/cache_pool.c
Log:
eliminate redundant counter.


Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c 2006-09-18 09:33:10 UTC (rev 1067)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2006-09-18 09:57:25 UTC (rev 1068)
@@ -37,7 +37,6 @@
MTX mtx;
struct workerhead idle;
TAILQ_HEAD(, workreq) req;
- unsigned overflow;
unsigned nwrk;
};

@@ -197,15 +196,15 @@
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 @@
}

TAILQ_INSERT_TAIL(&qp->req, &sp->workreq, list);
- qp->overflow++;
UNLOCK(&qp->mtx);

LOCK(&tmtx);