From: phk Date: Mon, 2 Mar 2009 17:29:11 +0000 (+0000) Subject: I was confused, always rush when we deref an *object*, it is the X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fd55f13cba9a4866fec182ba4e029080bebd130;p=varnish I was confused, always rush when we deref an *object*, it is the *objhead* we need to be careful about. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3859 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_hash.c b/varnish-cache/bin/varnishd/cache_hash.c index caf6bf26..9a597b1d 100644 --- a/varnish-cache/bin/varnishd/cache_hash.c +++ b/varnish-cache/bin/varnishd/cache_hash.c @@ -601,13 +601,12 @@ HSH_Deref(const struct worker *w, struct object **oo) CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); Lck_Lock(&oh->mtx); + assert(oh->refcnt > 0); assert(o->refcnt > 0); r = --o->refcnt; - if (!r) { - assert(VTAILQ_EMPTY(&oh->waitinglist)); + if (!r) VTAILQ_REMOVE(&oh->objcs, oc, list); - } else - hsh_rush(oh); + hsh_rush(oh); Lck_Unlock(&oh->mtx); }