[master] a3ab892 Add ASSERT_CLI() to a couple of backend handling functions

Martin Blix Grydeland martin at varnish-software.com
Mon Apr 3 13:46:06 CEST 2017


commit a3ab8922eb8e665dc6f510883425897680576e4b
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Fri Mar 31 11:00:03 2017 +0200

    Add ASSERT_CLI() to a couple of backend handling functions
    
    VBE_Delete() and VBE_Poll() are only safe to call from the CLI
    handling thread. Add ASSERT_CLI() to make that explicit.

diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c
index c5f3542..767a87c 100644
--- a/bin/varnishd/cache/cache_backend_cfg.c
+++ b/bin/varnishd/cache/cache_backend_cfg.c
@@ -194,6 +194,7 @@ VBE_Event(struct backend *be, enum vcl_event_e ev)
 void
 VBE_Delete(struct backend *be)
 {
+	ASSERT_CLI();
 	CHECK_OBJ_NOTNULL(be, BACKEND_MAGIC);
 
 	if (be->probe != NULL)
@@ -437,6 +438,7 @@ VBE_Poll(void)
 	struct backend *be;
 	double now = VTIM_real();
 
+	ASSERT_CLI();
 	Lck_Lock(&backends_mtx);
 	while (1) {
 		be = VTAILQ_FIRST(&cool_backends);



More information about the varnish-commit mailing list