summaryrefslogtreecommitdiff
path: root/build/apr_threads.m4
diff options
context:
space:
mode:
authorivan <ivan@13f79535-47bb-0310-9956-ffa450edef68>2023-01-21 16:13:27 +0000
committerivan <ivan@13f79535-47bb-0310-9956-ffa450edef68>2023-01-21 16:13:27 +0000
commite786a4b14c92e628ae3964d27f78759446a0b456 (patch)
tree6b009aab810e5a22ec6ff0c167af99b0dd5e733e /build/apr_threads.m4
parentf4a4ec18a1c723f22250bc2aeb6ca58e54bb265d (diff)
downloadlibapr-e786a4b14c92e628ae3964d27f78759446a0b456.tar.gz
Merge thread-name branch (PR 60587) [1]:
* Introduce apr_thread_name_set() and apr_thread_name_get(). [1] https://bz.apache.org/bugzilla/show_bug.cgi?id=60587 [2] https://lists.apache.org/thread/z24logzc6v8tc0p2q3375cc10qo9y5yw git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906889 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/apr_threads.m4')
-rw-r--r--build/apr_threads.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/build/apr_threads.m4 b/build/apr_threads.m4
index 6895c3a67..98e17de1b 100644
--- a/build/apr_threads.m4
+++ b/build/apr_threads.m4
@@ -312,3 +312,27 @@ elif test "$apr_cv_mutex_robust_shared" = "np"; then
[Define if non-posix/portable cross-process robust mutexes are available])
fi
])
+
+
+dnl Check for pthread_setname_np
+dnl Note: Only detects two-arg version
+AC_DEFUN([APR_CHECK_PTHREAD_SETNAME_NP], [
+AC_CACHE_CHECK([for pthread_setname_np support],
+[apr_cv_pthread_setname_np], [
+AC_TRY_COMPILE([
+#include <pthread.h>
+],[
+pthread_t td = pthread_self();
+pthread_setname_np(td, "name");
+],[
+ apr_cv_pthread_setname_np=yes
+],[
+ apr_cv_pthread_setname_np=no
+])])
+
+if test "$apr_cv_pthread_setname_np" = "yes"; then
+ AC_DEFINE([HAVE_PTHREAD_SETNAME_NP], 1,
+ [Define if pthread_setname_np is available])
+fi
+])dnl
+