r3648 - branches/2.0/varnish-cache/bin/varnishd

tfheen at projects.linpro.no tfheen at projects.linpro.no
Fri Feb 6 11:42:40 CET 2009


Author: tfheen
Date: 2009-02-06 11:42:40 +0100 (Fri, 06 Feb 2009)
New Revision: 3648

Modified:
   branches/2.0/varnish-cache/bin/varnishd/cache_hash.c
Log:
Merge r3448: Assert objhead

We cannot gain a reference to an object unless it has an objhead,
assert that we have one.



Modified: branches/2.0/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_hash.c	2009-02-06 10:39:34 UTC (rev 3647)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_hash.c	2009-02-06 10:42:40 UTC (rev 3648)
@@ -427,14 +427,11 @@
 
 	CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
 	oh = o->objhead;
-	if (oh != NULL) {
-		CHECK_OBJ(oh, OBJHEAD_MAGIC);
-		Lck_Lock(&oh->mtx);
-	}
+	CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
+	Lck_Lock(&oh->mtx);
 	assert(o->refcnt > 0);
 	o->refcnt++;
-	if (oh != NULL)
-		Lck_Unlock(&oh->mtx);
+	Lck_Unlock(&oh->mtx);
 }
 
 void



More information about the varnish-commit mailing list