VTAILQ_HEAD(, storage) store;
- VTAILQ_HEAD(, sess) waitinglist;
-
VTAILQ_HEAD(, esi_bit) esibits;
double lru_stamp;
VTAILQ_HEAD(,object) objects;
char *hash;
unsigned hashlen;
+ VTAILQ_HEAD(, sess) waitinglist;
};
/* -------------------------------------------------------------------*/
struct backend *backend;
struct bereq *bereq;
struct object *obj;
+ struct objhead *objhead;
struct VCL_conf *vcl;
/* Various internal stuff */
* We hit a busy object, disembark worker thread and expect
* hash code to restart us, still in STP_LOOKUP, later.
*/
- WSP(sp, SLT_Debug, "on waiting list on obj %u", sp->obj->xid);
+ WSP(sp, SLT_Debug, "on waiting list <%s>", sp->objhead->hash);
/*
* There is a non-zero risk that we come here more than once
* before we get through, in that case cnt_recv must be set
XXXAN(w->nobjhead);
w->nobjhead->magic = OBJHEAD_MAGIC;
VTAILQ_INIT(&w->nobjhead->objects);
+ VTAILQ_INIT(&w->nobjhead->waitinglist);
MTX_INIT(&w->nobjhead->mtx);
VSL_stats->n_objecthead++;
} else
w->nobj->busy = 1;
w->nobj->refcnt = 1;
VTAILQ_INIT(&w->nobj->store);
- VTAILQ_INIT(&w->nobj->waitinglist);
VTAILQ_INIT(&w->nobj->esibits);
VSL_stats->n_object++;
} else
h = sp->http;
HSH_Prealloc(sp);
- if (sp->obj != NULL) {
- CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
- oh = sp->obj->objhead;
- HSH_Deref(sp->obj);
+ if (sp->objhead != NULL) {
+ CHECK_OBJ_NOTNULL(sp->objhead, OBJHEAD_MAGIC);
+ oh = sp->objhead;
+ sp->objhead = NULL;
CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
LOCK(&oh->mtx);
} else {
VTAILQ_FOREACH(o, &oh->objects, list) {
if (o->busy) {
- VTAILQ_INSERT_TAIL(&o->waitinglist, sp, list);
- sp->obj = o;
- o->refcnt++;
+ VTAILQ_INSERT_TAIL(&oh->waitinglist, sp, list);
+ sp->objhead = oh;
UNLOCK(&oh->mtx);
return (NULL);
}
}
static void
-hsh_rush(struct object *o)
+hsh_rush(struct objhead *oh)
{
unsigned u;
struct sess *sp;
for (u = 0; u < params->rush_exponent; u++) {
- sp = VTAILQ_FIRST(&o->waitinglist);
+ sp = VTAILQ_FIRST(&oh->waitinglist);
if (sp == NULL)
return;
- VTAILQ_REMOVE(&o->waitinglist, sp, list);
+ VTAILQ_REMOVE(&oh->waitinglist, sp, list);
VSL(SLT_Debug, sp->id, "of waiting list");
WRK_QueueSession(sp);
}
LOCK(&oh->mtx);
}
o->busy = 0;
- hsh_rush(o);
+ hsh_rush(oh);
if (oh != NULL)
UNLOCK(&oh->mtx);
}
}
assert(o->refcnt > 0);
r = --o->refcnt;
- hsh_rush(o);
+ hsh_rush(oh);
if (oh != NULL) {
if (!r)
VTAILQ_REMOVE(&oh->objects, o, list);