Commit c3885ff0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't compile the pthread based memory-barrier fall back unless we

actually need it.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5158 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 956ea5a8
......@@ -74,6 +74,8 @@ void vmb_pthread(void);
#else
#define VMB_NEEDS_PTHREAD_WORKAROUND_THIS_IS_BAD_FOR_PERFORMANCE 1
#define VMB() vmb_pthread()
#define VWMB() vmb_pthread()
#define VRMB() vmb_pthread()
......
......@@ -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 @@ vmb_pthread(void)
AZ(pthread_mutex_lock(&mb_mtx));
AZ(pthread_mutex_unlock(&mb_mtx));
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment