[master] 83aa540 Use correct function for setting thread name.

Lasse Karstensen lkarsten at varnish-software.com
Thu Nov 26 15:10:03 CET 2015


commit 83aa5402eedbd27f46b382a2742efc404629e8f0
Author: Lasse Karstensen <lkarsten at varnish-software.com>
Date:   Thu Nov 26 15:05:56 2015 +0100

    Use correct function for setting thread name.
    
    Correct typo that checked for pthread_set_name_np() instead of
    pthread_setname_np().
    
    Thread names should now be visible in /proc/CHILDPID/tasks/*/comm on
    Linux systems.

diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index 83de0cd..bc15b7c 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -92,8 +92,8 @@ THR_SetName(const char *name)
 {
 
 	AZ(pthread_setspecific(name_key, name));
-#ifdef HAVE_PTHREAD_SET_NAME_NP
-	pthread_set_name_np(pthread_self(), name);
+#ifdef HAVE_PTHREAD_SETNAME_NP
+	pthread_setname_np(pthread_self(), name);
 #endif
 }
 
diff --git a/config.phk b/config.phk
index dea0eed..74e3391 100644
--- a/config.phk
+++ b/config.phk
@@ -287,7 +287,7 @@ exit 0
 # HAVE_DLADDR +
 # HAVE_KQUEUE +
 # HAVE_NANOSLEEP +
-# HAVE_PTHREAD_SET_NAME_NP +
+# HAVE_PTHREAD_SETNAME_NP +
 # HAVE_SETPROCTITLE +
 # HAVE_SRANDOMDEV +
 # HAVE_TCP_KEEP +
diff --git a/configure.ac b/configure.ac
index d56169f..d7c2d94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -248,7 +248,7 @@ AC_CHECK_FUNCS([fallocate])
 
 save_LIBS="${LIBS}"
 LIBS="${PTHREAD_LIBS}"
-AC_CHECK_FUNCS([pthread_set_name_np])
+AC_CHECK_FUNCS([pthread_setname_np])
 AC_CHECK_FUNCS([pthread_mutex_isowned_np])
 AC_CHECK_FUNCS([pthread_timedjoin_np])
 LIBS="${save_LIBS}"



More information about the varnish-commit mailing list