]> err.no Git - varnish/commitdiff
I was confused, always rush when we deref an *object*, it is the
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 2 Mar 2009 17:29:11 +0000 (17:29 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 2 Mar 2009 17:29:11 +0000 (17:29 +0000)
*objhead* we need to be careful about.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3859 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_hash.c

index caf6bf266c2fc796d83d410e8a5b15e028d3e424..9a597b1d27d3e27178dac278e037fc3fbd98e93f 100644 (file)
@@ -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);
        }