Skip to content

Commit

Permalink
Let other OS set the thread name as well
Browse files Browse the repository at this point in the history
Amends 83aa540 to handle FreeBSD and OpenBSD (at least).
  • Loading branch information
fgsch committed Nov 26, 2015
1 parent f063578 commit 982e796
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/varnishd/cache/cache_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ THR_SetName(const char *name)
{

AZ(pthread_setspecific(name_key, name));
#ifdef HAVE_PTHREAD_SETNAME_NP
#if defined(HAVE_PTHREAD_SET_NAME_NP)
pthread_set_name_np(pthread_self(), name);
#elif defined(HAVE_PTHREAD_SETNAME_NP)
pthread_setname_np(pthread_self(), name);
#endif
}
Expand Down
1 change: 1 addition & 0 deletions config.phk
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ exit 0
# HAVE_DLADDR +
# HAVE_KQUEUE +
# HAVE_NANOSLEEP +
# HAVE_PTHREAD_SET_NAME_NP +
# HAVE_PTHREAD_SETNAME_NP +
# HAVE_SETPROCTITLE +
# HAVE_SRANDOMDEV +
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +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])
Expand Down

0 comments on commit 982e796

Please sign in to comment.