[master] 34684ee3e reduce code within the vbp_mtx critical section insignificantly

Nils Goroll nils.goroll at uplex.de
Wed Apr 17 09:42:06 UTC 2019


commit 34684ee3e29dfa09fdd9b736e2e4d002a6fe6c93
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Apr 17 11:37:34 2019 +0200

    reduce code within the vbp_mtx critical section insignificantly
    
    We could also move the VSL() outside if we copied dir->vcl_name

diff --git a/bin/varnishd/cache/cache_backend_probe.c b/bin/varnishd/cache/cache_backend_probe.c
index 6dda4273a..c99b0abea 100644
--- a/bin/varnishd/cache/cache_backend_probe.c
+++ b/bin/varnishd/cache/cache_backend_probe.c
@@ -158,18 +158,18 @@ VBP_Update_Backend(struct vbp_target *vt)
 
 	CHECK_OBJ_NOTNULL(vt, VBP_TARGET_MAGIC);
 
+#define BITMAP(n, c, t, b)			\
+	bits[i++] = (vt->n & 1) ? c : '-';
+#include "tbl/backend_poll.h"
+	bits[i] = '\0';
+	assert(i < sizeof bits);
+
 	Lck_Lock(&vbp_mtx);
 	if (vt->backend == NULL) {
 		Lck_Unlock(&vbp_mtx);
 		return;
 	}
 
-#define BITMAP(n, c, t, b) \
-	bits[i++] = (vt->n & 1) ? c : '-';
-#include "tbl/backend_poll.h"
-	bits[i] = '\0';
-	assert(i < sizeof bits);
-
 	dir = vt->backend->director;
 	if (dir == NULL) {
 		Lck_Unlock(&vbp_mtx);


More information about the varnish-commit mailing list