Prefer the pthread_barrier implementation over uv_barrier

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 d07c4a98da)
This commit is contained in:
Ondřej Surý 2023-01-11 09:28:10 +01:00
parent fa53e4f87c
commit 6906b42cdd
2 changed files with 2 additions and 2 deletions

View 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],

View file

@ -15,7 +15,7 @@
#include <isc/util.h>
#if __SANITIZE_THREAD__
#if HAVE_PTHREAD_BARRIER_INIT
#include <pthread.h>