LIBS=""
AC_SEARCH_LIBS(pthread_create, [thr pthread c_r])
PTHREAD_LIBS="${LIBS}"
-# Check for thread naming function
-AC_CHECK_FUNCS([pthread_set_name_np])
LIBS="${save_LIBS}"
AC_SUBST(PTHREAD_LIBS)
AC_CHECK_HEADERS([sys/statvfs.h])
AC_CHECK_HEADERS([sys/vfs.h])
AC_CHECK_HEADERS([netinet/in.h])
+AC_CHECK_HEADERS([pthread_np.h])
AC_CHECK_HEADERS([stddef.h])
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([vis.h])
-AC_CHECK_HEADERS([pthread_np.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_CHECK_FUNCS([fmtcheck])
AC_CHECK_FUNCS([getdtablesize])
+save_LIBS="${LIBS}"
+LIBS="${PTHREAD_LIBS}"
+AC_CHECK_FUNCS([pthread_set_name_np])
+AC_CHECK_FUNCS([pthread_mutex_islocked_np])
+LIBS="${save_LIBS}"
+
## This one is tricky, there are multiple versions
case $host in
*-*-freebsd*)