]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Prefer the pthread_barrier implementation over uv_barrier
authorOndřej Surý <ondrej@isc.org>
Wed, 11 Jan 2023 08:28:10 +0000 (09:28 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 11 Jan 2023 10:21:39 +0000 (10:21 +0000)
Prefer the pthread_barrier implementation on platforms where it is
available over uv_barrier implementation.  This also solves the problem
with thread sanitizer builds on macOS that doesn't have pthread barrier.

(cherry picked from commit d07c4a98da3d930aca83465347a4dd7bb423909f)

configure.ac
lib/isc/include/isc/barrier.h

index aac4b1db74a5c143d4fae7aff1bad7df5ca2d584..d087762da8cdaee85827f226476aeb4bfa84d465 100644 (file)
@@ -498,7 +498,7 @@ LIBS="$PTHREAD_LIBS $LIBS"
 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 CC="$PTHREAD_CC"
 
-AC_CHECK_FUNCS([pthread_attr_getstacksize pthread_attr_setstacksize])
+AC_CHECK_FUNCS([pthread_attr_getstacksize pthread_attr_setstacksize pthread_barrier_init])
 
 # [pairwise: --with-locktype=adaptive, --with-locktype=standard]
 AC_ARG_WITH([locktype],
index 2ff380e1587e8fb8b29c59620566709ddfd2fcea..a60472fd0247ba75f2fb214e0b8118577c0b3ce2 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <isc/util.h>
 
-#if __SANITIZE_THREAD__
+#if HAVE_PTHREAD_BARRIER_INIT
 
 #include <pthread.h>