Skip to content

Commit

Permalink
Use pthread_set_name_np when it available
Browse files Browse the repository at this point in the history
  • Loading branch information
catap committed Dec 23, 2024
1 parent fa5af22 commit f9c469d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/varnishd/cache/cache_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ THR_SetName(const char *name)
# else
thr_setname_generic(name);
# endif
#elif defined(HAVE_PTHREAD_SET_NAME_NP)
(void)pthread_set_name_np(pthread_self(), name);
#endif
}

Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ AC_CHECK_FUNCS([fnmatch], [], [AC_MSG_ERROR([fnmatch(3) is required])])
save_LIBS="${LIBS}"
LIBS="${PTHREAD_LIBS}"
AC_CHECK_FUNCS([pthread_setname_np])
AC_CHECK_FUNCS([pthread_set_name_np])
AC_CHECK_FUNCS([pthread_mutex_isowned_np])
AC_CHECK_FUNCS([pthread_getattr_np])
LIBS="${save_LIBS}"
Expand Down

0 comments on commit f9c469d

Please sign in to comment.