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

This commit is contained in:
Brad Smith 2024-09-02 02:38:23 -04:00 committed by GitHub
parent dd5d730072
commit d2ce9dc85e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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