[4.0] d418ffa Rush the objheader if there is a waiting list when it is deref'ed.

Martin Blix Grydeland martin at varnish-software.com
Mon Jan 25 15:59:37 CET 2016


commit d418ffab7c86071f330acfd3e45bbb59616036b4
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jan 6 19:13:47 2016 +0000

    Rush the objheader if there is a waiting list when it is deref'ed.
    
    Fixes:	#1823

diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index b666d07..a948372 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -864,6 +864,11 @@ HSH_DerefObjHead(struct dstat *ds, struct objhead **poh)
 		oh->refcnt--;
 		Lck_Unlock(&oh->mtx);
 		return(1);
+	} else if (oh->waitinglist != NULL) {
+		Lck_Lock(&oh->mtx);
+		if (oh->waitinglist != NULL)
+			hsh_rush(ds, oh);
+		Lck_Unlock(&oh->mtx);
 	}
 
 	assert(oh->refcnt > 0);



More information about the varnish-commit mailing list