r5158 - in trunk/varnish-cache: include lib/libvarnish
phk at varnish-cache.org
phk at varnish-cache.org
Mon Aug 30 14:52:09 CEST 2010
Author: phk
Date: 2010-08-30 14:52:09 +0200 (Mon, 30 Aug 2010)
New Revision: 5158
Modified:
trunk/varnish-cache/include/vmb.h
trunk/varnish-cache/lib/libvarnish/vmb.c
Log:
Don't compile the pthread based memory-barrier fall back unless we
actually need it.
Modified: trunk/varnish-cache/include/vmb.h
===================================================================
--- trunk/varnish-cache/include/vmb.h 2010-08-30 12:44:50 UTC (rev 5157)
+++ trunk/varnish-cache/include/vmb.h 2010-08-30 12:52:09 UTC (rev 5158)
@@ -74,6 +74,8 @@
#else
+#define VMB_NEEDS_PTHREAD_WORKAROUND_THIS_IS_BAD_FOR_PERFORMANCE 1
+
#define VMB() vmb_pthread()
#define VWMB() vmb_pthread()
#define VRMB() vmb_pthread()
Modified: trunk/varnish-cache/lib/libvarnish/vmb.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/vmb.c 2010-08-30 12:44:50 UTC (rev 5157)
+++ trunk/varnish-cache/lib/libvarnish/vmb.c 2010-08-30 12:52:09 UTC (rev 5158)
@@ -30,6 +30,8 @@
#include "libvarnish.h"
#include "vmb.h"
+#ifdef VMB_NEEDS_PTHREAD_WORKAROUND_THIS_IS_BAD_FOR_PERFORMANCE
+
static pthread_mutex_t mb_mtx;
static pthread_once_t mb_mtx_once = PTHREAD_ONCE_INIT;
@@ -50,3 +52,5 @@
AZ(pthread_mutex_lock(&mb_mtx));
AZ(pthread_mutex_unlock(&mb_mtx));
}
+
+#endif
More information about the varnish-commit
mailing list