aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Unix/Threading.inc
diff options
context:
space:
mode:
authorBrad Smith <brad@comstyle.com>2025-09-01 06:07:13 -0400
committerGitHub <noreply@github.com>2025-09-01 06:07:13 -0400
commit10e5ec84573f83c172fc77da92252b60164b52b5 (patch)
tree300183d6b882f957cff46c66142d4d5b8c9342df /llvm/lib/Support/Unix/Threading.inc
parent27c80fba53cd44ff3d575c6049bf88ecf6c15bc2 (diff)
downloadllvm-10e5ec84573f83c172fc77da92252b60164b52b5.zip
llvm-10e5ec84573f83c172fc77da92252b60164b52b5.tar.gz
llvm-10e5ec84573f83c172fc77da92252b60164b52b5.tar.bz2
[Support] Also check the value for HAVE_PTHREAD_(SETNAME/SET_NAME)_NP (#156294)
As was already done for HAVE_PTHREAD_(GETNAME/GET_NAME)_NP
Diffstat (limited to 'llvm/lib/Support/Unix/Threading.inc')
-rw-r--r--llvm/lib/Support/Unix/Threading.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc
index 7854d6d..f016ed6 100644
--- a/llvm/lib/Support/Unix/Threading.inc
+++ b/llvm/lib/Support/Unix/Threading.inc
@@ -194,9 +194,9 @@ void llvm::set_thread_name(const Twine &Name) {
if (get_max_thread_name_length() > 0)
NameStr = NameStr.take_back(get_max_thread_name_length() - 1);
(void)NameStr;
-#if defined(HAVE_PTHREAD_SET_NAME_NP)
+#if defined(HAVE_PTHREAD_SET_NAME_NP) && HAVE_PTHREAD_SET_NAME_NP
::pthread_set_name_np(::pthread_self(), NameStr.data());
-#elif defined(HAVE_PTHREAD_SETNAME_NP)
+#elif defined(HAVE_PTHREAD_SETNAME_NP) && HAVE_PTHREAD_SETNAME_NP
#if defined(__NetBSD__)
::pthread_setname_np(::pthread_self(), "%s",
const_cast<char *>(NameStr.data()));