Commit ed645d24 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Remove busyobj from objcore under oh-mtx

parent c40a7d0c
......@@ -35,10 +35,11 @@
#include "cache.h"
#include "hash/hash_slinger.h"
#include "cache_backend.h"
#include "vcli_priv.h"
#include "vct.h"
#include "vmb.h"
#include "vtcp.h"
static unsigned fetchfrag;
......@@ -675,11 +676,8 @@ FetchBody(struct worker *wrk, void *priv)
/* XXX: Atomic assignment, needs volatile/membar ? */
bo->state = BOS_FINISHED;
}
if (obj->objcore != NULL) {
VMB();
obj->objcore->busyobj = NULL;
VMB();
}
if (obj->objcore != NULL)
HSH_Complete(obj->objcore);
bo->stats = NULL;
VBO_DerefBusyObj(wrk, &bo);
}
......
......@@ -565,6 +565,24 @@ HSH_Drop(struct worker *wrk, struct object **oo)
AZ(HSH_Deref(&wrk->stats, NULL, oo));
}
/*---------------------------------------------------------------------
* Remove the busyobj from an objcore
*/
void
HSH_Complete(struct objcore *oc)
{
struct objhead *oh;
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
oh = oc->objhead;
CHECK_OBJ(oh, OBJHEAD_MAGIC);
Lck_Lock(&oh->mtx);
oc->busyobj = NULL;
Lck_Unlock(&oh->mtx);
}
/*---------------------------------------------------------------------
* Unbusy an objcore when the object is completely fetched.
*/
......
......@@ -94,6 +94,7 @@ struct objhead {
};
void HSH_Unbusy(struct dstat *, struct objcore *);
void HSH_Complete(struct objcore *oc);
void HSH_DeleteObjHead(struct dstat *, struct objhead *oh);
int HSH_Deref(struct dstat *, struct objcore *oc, struct object **o);
#endif /* VARNISH_CACHE_CHILD */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment