From af4b8f8987248e442faaad339261332e05e254b8 Mon Sep 17 00:00:00 2001 Date: Sun, 16 May 2021 12:21:10 -0700 Subject: [PATCH 07/24] Threading: Only call pthread_setname_np() if we have it --- llvm/lib/Support/Unix/Threading.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc index 667d023fc134..8162c60b2cdd 100644 --- a/llvm/lib/Support/Unix/Threading.inc +++ b/llvm/lib/Support/Unix/Threading.inc @@ -176,8 +176,10 @@ void llvm::set_thread_name(const Twine &Name) { ::pthread_setname_np(::pthread_self(), "%s", const_cast(NameStr.data())); #elif defined(__APPLE__) +#if HAVE_PTHREAD_SETNAME_NP ::pthread_setname_np(NameStr.data()); #endif +#endif } void llvm::get_thread_name(SmallVectorImpl &Name) { -- 2.21.1 (Apple Git-122.3)