BBlack has submitted this change and it was merged.

Change subject: get rid of init mutex - really isn't needed
......................................................................


get rid of init mutex - really isn't needed

Change-Id: I0b07a20d2d66d89873b4222484139e0c9ce905e2
---
M src/vmod_netmapper.c
1 file changed, 0 insertions(+), 13 deletions(-)

Approvals:
  BBlack: Verified; Looks good to me, approved



diff --git a/src/vmod_netmapper.c b/src/vmod_netmapper.c
index c2551cb..cca44cd 100644
--- a/src/vmod_netmapper.c
+++ b/src/vmod_netmapper.c
@@ -123,19 +123,7 @@
  * Actual VMOD/VCL/VRT Hooks *
  *****************************/
 
-// we serialize all calls to vmod_init() for this vmod globally, because
-//   (a) it's not a perf hotspot anyways and
-//   (b) it is critical that this executes serially for all .init() calls
-//     at *least* within a given VCL (PRIV_VCL context).
-//   (c) I'm not 100% sure that varnish will never call this from two threads
-//     in parallel, either now or in the future, during startup with multiple
-//     VCLs using the module, etc.
-pthread_mutex_t serial_init = PTHREAD_MUTEX_INITIALIZER;
-
 void vmod_init(struct sess *sp, struct vmod_priv *priv, const char* db_label, 
const char* json_path, const int reload_interval) {
-
-    pthread_mutex_lock(&serial_init);
-
     vnm_priv_t* vp = priv->priv;
 
     if(!vp) {
@@ -155,7 +143,6 @@
     if(!dbf->db)
         VSL(SLT_Error, 0, "vmod_netmapper: Failed initial load of JSON 
netmapper database %s (will keep trying periodically)", dbf->fn);
 
-    pthread_mutex_unlock(&serial_init);
     pthread_create(&dbf->updater, NULL, updater_start, dbf);
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/99548
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b07a20d2d66d89873b4222484139e0c9ce905e2
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/varnish/libvmod-netmapper
Gerrit-Branch: master
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to