[PATCH] D78029: Support Apple platforms in llvm::get_thread_name

Sergej Jaskiewicz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 09:07:08 PDT 2020


broadwaylamb created this revision.
broadwaylamb added a reviewer: zturner.
Herald added subscribers: llvm-commits, hiraditya, krytarowski.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78029

Files:
  llvm/lib/Support/Unix/Threading.inc


Index: llvm/lib/Support/Unix/Threading.inc
===================================================================
--- llvm/lib/Support/Unix/Threading.inc
+++ llvm/lib/Support/Unix/Threading.inc
@@ -219,7 +219,7 @@
   ::pthread_get_name_np(::pthread_self(), buf, len);
 
   Name.append(buf, buf + strlen(buf));
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__APPLE__)
 #if HAVE_PTHREAD_GETNAME_NP
   constexpr uint32_t len = get_max_thread_name_length_impl();
   char Buffer[len] = {'\0'};  // FIXME: working around MSan false positive.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78029.256996.patch
Type: text/x-patch
Size: 550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200413/6b5c09af/attachment.bin>


More information about the llvm-commits mailing list