[master] 6924df1 Always close under the mutex

Poul-Henning Kamp phk at FreeBSD.org
Mon Jan 26 16:16:42 CET 2015


commit 6924df1382ae4c18e7804b724fd0a49b7f6c0f24
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 26 15:16:33 2015 +0000

    Always close under the mutex

diff --git a/bin/varnishd/cache/cache_backend_tcp.c b/bin/varnishd/cache/cache_backend_tcp.c
index 644068b..24ff61b 100644
--- a/bin/varnishd/cache/cache_backend_tcp.c
+++ b/bin/varnishd/cache/cache_backend_tcp.c
@@ -346,8 +346,8 @@ VBT_Close(struct tcp_pool *tp, struct vbc **vbcp)
 	assert(vbc->fd > 0);
 VSL(SLT_Debug, 0, "------> Close fd %d in_w %d", vbc->fd, vbc->in_waiter);
 
-	VTCP_close(&vbc->fd);
 	Lck_Lock(&tp->mtx);
+	VTCP_close(&vbc->fd);
 	tp->n_used--;
 	if (vbc->in_waiter) {
 		vbc->state = VBC_STATE_CLEANUP;



More information about the varnish-commit mailing list