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)
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],
#include <isc/util.h>
-#if __SANITIZE_THREAD__
+#if HAVE_PTHREAD_BARRIER_INIT
#include <pthread.h>