[master] 518a64d7c Revert "varnishtest: Bandaid for an uninitialized mutex"

Nils Goroll nils.goroll at uplex.de
Tue Jan 12 22:24:13 UTC 2021


commit 518a64d7c08939f58068a79c4a570b0a3a964ea7
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Jan 12 23:17:51 2021 +0100

    Revert "varnishtest: Bandaid for an uninitialized mutex"
    
    Fix in next commit
    
    This reverts commit f855fa46fb1ad66f16e264d57129d605e87f33c4.

diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c
index 97e895ca0..017c53950 100644
--- a/bin/varnishtest/vtc.c
+++ b/bin/varnishtest/vtc.c
@@ -139,12 +139,9 @@ extmacro_def(const char *name, const char *fmt, ...)
 
 /**********************************************************************
  * Below this point is run inside the testing child-process.
- *
- * XXX: This is no longer the case for macro_get() that is currently
- * used in the main process.
  */
 
-static pthread_mutex_t macro_mtx = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t		macro_mtx;
 
 static void
 init_macro(void)
@@ -154,6 +151,8 @@ init_macro(void)
 	/* Dump the extmacros for completeness */
 	VTAILQ_FOREACH(m, &macro_list, list)
 		vtc_log(vltop, 4, "extmacro def %s=%s", m->name, m->val);
+
+	AZ(pthread_mutex_init(&macro_mtx, NULL));
 }
 
 void


More information about the varnish-commit mailing list