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

via Openmp-commits openmp-commits at lists.llvm.org
Wed Aug 28 22:16:16 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 5795f9e27390fe5c322853476b3c9ba8376e8541 eff3998abd1572e0dcd257041630c0259f8e91bc --extensions cpp -- openmp/runtime/src/z_Linux_util.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/openmp/runtime/src/z_Linux_util.cpp b/openmp/runtime/src/z_Linux_util.cpp
index 3f3327378f..56e55c7010 100644
--- a/openmp/runtime/src/z_Linux_util.cpp
+++ b/openmp/runtime/src/z_Linux_util.cpp
@@ -881,19 +881,18 @@ void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) {
     KMP_SYSFAIL("pthread_create", status);
   }
 
-#if defined(LIBOMP_HAVE_PTHREAD_SETNAME_NP) || \
+#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");
+    pthread_setname_np(handle, "openmp_worker");
 #elif defined(__FreeBSD__) || defined(__OpenBSD__)
-  pthread_set_name_np(handle, "openmp_worker");
+    pthread_set_name_np(handle, "openmp_worker");
 #elif defined(__NetBSD__)
-  pthread_setname_np(handle, "%s",
-                       const_cast<char *>("openmp_worker"));
+    pthread_setname_np(handle, "%s", const_cast<char *>("openmp_worker"));
 #elif defined(__APPLE__)
-  pthread_setname_np("openmp_worker");
+    pthread_setname_np("openmp_worker");
 #endif
   }
 #endif

``````````

</details>


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


More information about the Openmp-commits mailing list