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

We cannot assume that nobody else have killed the object we are

trying to snipe.  If they did, fail the sniping.

Fixes #1942
parent 3e3357f9
......@@ -724,10 +724,8 @@ HSH_Snipe(const struct worker *wrk, struct objcore *oc)
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
CHECK_OBJ_NOTNULL(oc->objhead, OBJHEAD_MAGIC);
AZ(oc->flags & OC_F_DYING);
if (oc->refcnt == 1 && !Lck_Trylock(&oc->objhead->mtx)) {
if (oc->refcnt == 1) {
if (oc->refcnt == 1 && !(oc->flags & OC_F_DYING)) {
oc->flags |= OC_F_DYING;
oc->refcnt++;
retval = 1;
......
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