[llvm] d2ce9dc - Add support for retrieving the thread ID on DragonFly BSD (#106938)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 1 23:38:26 PDT 2024


Author: Brad Smith
Date: 2024-09-02T02:38:23-04:00
New Revision: d2ce9dc85e5d94e19a69d4a72e7b9197447d480a

URL: https://github.com/llvm/llvm-project/commit/d2ce9dc85e5d94e19a69d4a72e7b9197447d480a
DIFF: https://github.com/llvm/llvm-project/commit/d2ce9dc85e5d94e19a69d4a72e7b9197447d480a.diff

LOG: Add support for retrieving the thread ID on DragonFly BSD (#106938)

Added: 
    

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

Removed: 
    


################################################################################
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());


        


More information about the llvm-commits mailing list