r3857 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Mon Mar 2 15:38:55 CET 2009
Author: phk
Date: 2009-03-02 15:38:55 +0100 (Mon, 02 Mar 2009)
New Revision: 3857
Modified:
trunk/varnish-cache/bin/varnishd/cache_hash.c
Log:
Clarify the waitinglist handling a little bit
Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c 2009-03-02 13:39:09 UTC (rev 3856)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2009-03-02 14:38:55 UTC (rev 3857)
@@ -521,25 +521,23 @@
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
o = sp->obj;
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
+ oh = o->objhead;
+ CHECK_OBJ(oh, OBJHEAD_MAGIC);
+
AN(ObjIsBusy(o));
assert(o->objcore->obj == o);
assert(o->refcnt > 0);
+ assert(oh->refcnt > 0);
if (o->ws_o->overflow)
VSL_stats->n_objoverflow++;
if (params->diag_bitmap & 0x40)
WSP(sp, SLT_Debug,
"Object %u workspace free %u", o->xid, WS_Free(o->ws_o));
- oh = o->objhead;
- if (oh != NULL) {
- CHECK_OBJ(oh, OBJHEAD_MAGIC);
- Lck_Lock(&oh->mtx);
- }
+ Lck_Lock(&oh->mtx);
o->objcore->flags &= ~OC_F_BUSY;
- if (oh != NULL) {
- hsh_rush(oh);
- Lck_Unlock(&oh->mtx);
- }
+ hsh_rush(oh);
+ Lck_Unlock(&oh->mtx);
}
void
@@ -605,9 +603,10 @@
Lck_Lock(&oh->mtx);
assert(o->refcnt > 0);
r = --o->refcnt;
- if (!r)
+ if (!r) {
+ assert(VTAILQ_EMPTY(&oh->waitinglist));
VTAILQ_REMOVE(&oh->objcs, oc, list);
- else
+ } else
hsh_rush(oh);
Lck_Unlock(&oh->mtx);
}
More information about the varnish-commit
mailing list