Commit 34499f6a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

The grim reaper needs to wait for objects refcount to drop to zero.



git-svn-id: http://www.varnish-cache.org/svn/trunk@355 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 3cf04744
......@@ -53,8 +53,13 @@ exp_hangman(void *arg)
while (1) {
time (&t);
AZ(pthread_mutex_lock(&exp_mtx));
o = TAILQ_FIRST(&exp_deathrow);
if (o == NULL || o->ttl >= t) { /* XXX: > or >= ? */
TAILQ_FOREACH(o, &exp_deathrow, deathrow) {
if (o->ttl >= t)
break;
if (o->refcnt == 0)
break;
}
if (o == NULL || o->ttl >= t || o->refcnt > 0) {
AZ(pthread_mutex_unlock(&exp_mtx));
sleep(1);
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment