[Openmp-commits] [openmp] [OpenMP] Support setting POSIX thread name on *BSD's and macOS (PR #106489)
YAMAMOTO Takashi via Openmp-commits
openmp-commits at lists.llvm.org
Wed Aug 28 22:38:32 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__)
----------------
yamt wrote:
a question; why in some places do you check `KMP_OS_OPENBSD` and in other places `__OpenBSD__`?
https://github.com/llvm/llvm-project/pull/106489
More information about the Openmp-commits
mailing list