Skip to content

Add support for retrieving the thread ID on DragonFly BSD #106938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Sep 2, 2024

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Sep 2, 2024

@llvm/pr-subscribers-llvm-support

Author: Brad Smith (brad0)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/106938.diff

1 Files Affected:

  • (modified) llvm/lib/Support/Unix/Threading.inc (+2-2)
diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc
index 6ba6395e6b8d63..1812d990f21ac1 100644
--- a/llvm/lib/Support/Unix/Threading.inc
+++ b/llvm/lib/Support/Unix/Threading.inc
@@ -29,7 +29,7 @@
 
 #include <pthread.h>
 
-#if defined(__FreeBSD__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
 #include <pthread_np.h> // For pthread_getthreadid_np() / pthread_set_name_np()
 #endif
 
@@ -121,7 +121,7 @@ uint64_t llvm::get_threadid() {
     return InitSelf;
   }();
   return Self;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
   return uint64_t(pthread_getthreadid_np());
 #elif defined(__NetBSD__)
   return uint64_t(_lwp_self());

@brad0 brad0 merged commit d2ce9dc into llvm:main Sep 2, 2024
10 checks passed
@brad0 brad0 deleted the llvm_unix_support_threadid_dragonfly branch September 2, 2024 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants