[llvm] r335426 - Add OpenBSD support to the Threading code
Brad Smith via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 23 15:02:59 PDT 2018
Author: brad
Date: Sat Jun 23 15:02:59 2018
New Revision: 335426
URL: http://llvm.org/viewvc/llvm-project?rev=335426&view=rev
Log:
Add OpenBSD support to the Threading code
Modified:
llvm/trunk/lib/Support/Unix/Threading.inc
Modified: llvm/trunk/lib/Support/Unix/Threading.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Threading.inc?rev=335426&r1=335425&r2=335426&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Threading.inc (original)
+++ llvm/trunk/lib/Support/Unix/Threading.inc Sat Jun 23 15:02:59 2018
@@ -21,8 +21,8 @@
#include <pthread.h>
-#if defined(__FreeBSD__)
-#include <pthread_np.h> // For pthread_getthreadid_np()
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
+#include <pthread_np.h> // For pthread_getthreadid_np() / pthread_set_name_np()
#endif
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
@@ -117,6 +117,8 @@ static constexpr uint32_t get_max_thread
#endif
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
return 16;
+#elif defined(__OpenBSD__)
+ return 32;
#else
return 0;
#endif
@@ -146,7 +148,7 @@ void llvm::set_thread_name(const Twine &
::pthread_setname_np(::pthread_self(), NameStr.data());
#endif
#endif
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
::pthread_set_name_np(::pthread_self(), NameStr.data());
#elif defined(__NetBSD__)
::pthread_setname_np(::pthread_self(), "%s",
More information about the llvm-commits
mailing list