emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add pthread_set_name_np support


From: Robert Pluim
Subject: Re: add pthread_set_name_np support
Date: Mon, 29 Jun 2020 10:26:59 +0200

>>>>> On Sat, 27 Jun 2020 15:51:50 +0300, timo.myyra@bittivirhe.fi (Timo Myyrä) 
>>>>> said:

    Timo> diff --git a/configure.ac b/configure.ac
    Timo> index b1b8c846e1..f198894e02 100644
    Timo> --- a/configure.ac
    Timo> +++ b/configure.ac
    Timo> @@ -4187,7 +4187,8 @@ AC_DEFUN
    Timo>  sendto recvfrom getsockname getifaddrs freeifaddrs \
    Timo>  gai_strerror sync \
    Timo>  getpwent endpwent getgrent endgrent \
    Timo> -cfmakeraw cfsetspeed __executable_start log2 pthread_setname_np)
    Timo> +cfmakeraw cfsetspeed __executable_start log2 pthread_setname_np \
    Timo> +pthread_set_name_np)
    Timo>  LIBS=$OLD_LIBS
 
    Timo>  if test "$ac_cv_func_pthread_setname_np" = "yes"; then
    Timo> @@ -4222,6 +4223,23 @@ AC_DEFUN
    Timo>    fi
    Timo>  fi

Iʼm confused; why do you need the explicit check for
pthread_set_name_np when the AC_CHECK_FUNCS call above already checks
for it (and sets HAVE_PTHREAD_SET_NAME_NP if successful).

    Timo> +if test "$ac_cv_func_pthread_set_name_np" = "yes"; then
    Timo> +  AC_CACHE_CHECK(
    Timo> +   [whether pthread_set_name_np is supported],
    Timo> +   [emacs_cv_pthread_set_name_np],
    Timo> +   [AC_COMPILE_IFELSE(
    Timo> +     [AC_LANG_PROGRAM(
    Timo> +       [[#include <pthread.h>][#include <pthread_np.h>]],
    Timo> +       [[pthread_setname_np (1, "a");]])],
    Timo> +     [emacs_cv_pthread_set_name_np=yes],
    Timo> +     [emacs_cv_pthread_set_name_np=no])])
    Timo> +  if test "$emacs_cv_pthread_set_name_np" = "yes"; then
    Timo> +    AC_DEFINE(
    Timo> +      HAVE_PTHREAD_SET_NAME_NP, 1,
    Timo> +      [Define to 1 if pthread_set_name_np is supported.])
    Timo> +  fi
    Timo> +fi
    Timo> +



reply via email to

[Prev in Thread] Current Thread [Next in Thread]