mirror of
https://github.com/Icinga/icinga2.git
synced 2025-12-14 17:24:16 +01:00
Add tests for pthread_set_name_np() and pthread_setname_np()
Looks like the conversion from autoconf to CMake dropped these tests along the way.
This commit is contained in:
parent
883601ea95
commit
cf8fc3d64f
@ -371,6 +371,8 @@ check_function_exists(backtrace_symbols HAVE_BACKTRACE_SYMBOLS)
|
||||
check_function_exists(pipe2 HAVE_PIPE2)
|
||||
check_function_exists(nice HAVE_NICE)
|
||||
check_function_exists(malloc_info HAVE_MALLOC_INFO)
|
||||
check_function_exists(pthread_set_name_np HAVE_PTHREAD_SET_NAME_NP)
|
||||
check_function_exists(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
|
||||
check_library_exists(dl dladdr "dlfcn.h" HAVE_DLADDR)
|
||||
check_library_exists(execinfo backtrace_symbols "" HAVE_LIBEXECINFO)
|
||||
check_include_file_cxx(cxxabi.h HAVE_CXXABI_H)
|
||||
|
||||
@ -9,6 +9,8 @@
|
||||
#cmakedefine HAVE_CXXABI_H
|
||||
#cmakedefine HAVE_NICE
|
||||
#cmakedefine HAVE_MALLOC_INFO
|
||||
#cmakedefine HAVE_PTHREAD_SET_NAME_NP
|
||||
#cmakedefine HAVE_PTHREAD_SETNAME_NP
|
||||
#cmakedefine HAVE_EDITLINE
|
||||
#cmakedefine HAVE_SYSTEMD
|
||||
|
||||
|
||||
@ -1320,9 +1320,7 @@ void Utility::SetThreadName(const String& name, bool os)
|
||||
|
||||
#ifdef HAVE_PTHREAD_SET_NAME_NP
|
||||
pthread_set_name_np(pthread_self(), name.CStr());
|
||||
#endif /* HAVE_PTHREAD_SET_NAME_NP */
|
||||
|
||||
#ifdef HAVE_PTHREAD_SETNAME_NP
|
||||
#elif defined(HAVE_PTHREAD_SETNAME_NP) /* HAVE_PTHREAD_SET_NAME_NP */
|
||||
# ifdef __APPLE__
|
||||
pthread_setname_np(name.CStr());
|
||||
# else /* __APPLE__ */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user