[Openmp-commits] [openmp] [OpenMP] Support setting POSIX thread name on *BSD's and macOS (PR #106489)

Brad Smith via Openmp-commits openmp-commits at lists.llvm.org
Wed Aug 28 22:55:20 PDT 2024


================
@@ -878,10 +881,19 @@ void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) {
     KMP_SYSFAIL("pthread_create", status);
   }
 
-#ifdef LIBOMP_HAVE_LINUX_PTHREAD_SETNAME
+#if defined(LIBOMP_HAVE_PTHREAD_SETNAME_NP) ||                                 \
+    defined(LIBOMP_HAVE_PTHREAD_SET_NAME_NP)
   // Rename worker threads for improved debuggability
   if (!KMP_UBER_GTID(gtid)) {
+#if defined(__linux__)
     pthread_setname_np(handle, "openmp_worker");
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
----------------
brad0 wrote:

That's a good point. I have fixed that.

https://github.com/llvm/llvm-project/pull/106489


More information about the Openmp-commits mailing list