[PATCH 08/25] Add a condvar to struct vbo

Martin Blix Grydeland martin at varnish-software.com
Sun Jan 22 18:53:14 CET 2012


---
 bin/varnishd/cache/cache_busyobj.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index b8b6fd7..423df93 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -42,6 +42,7 @@ struct vbo {
 	unsigned		magic;
 #define VBO_MAGIC		0xde3d8223
 	struct lock		mtx;
+	pthread_cond_t		cond;
 	unsigned		refcount;
 	uint16_t		nhttp;
 	struct busyobj		bo;
@@ -80,6 +81,7 @@ vbo_New(void)
 	vbo->magic = VBO_MAGIC;
 	vbo->nhttp = nhttp;
 	Lck_New(&vbo->mtx, lck_busyobj);
+	AZ(pthread_cond_init(&vbo->cond, NULL));
 	return (vbo);
 }
 
@@ -94,6 +96,7 @@ VBO_Free(struct vbo **vbop)
 	CHECK_OBJ_NOTNULL(vbo, VBO_MAGIC);
 	AZ(vbo->refcount);
 	Lck_Delete(&vbo->mtx);
+	AZ(pthread_cond_destroy(&vbo->cond));
 	FREE_OBJ(vbo);
 }
 
-- 
1.7.4.1




More information about the varnish-dev mailing list