summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix
diff options
context:
space:
mode:
authorBrad Smith <brad@comstyle.com>2018-06-23 22:02:59 +0000
committerBrad Smith <brad@comstyle.com>2018-06-23 22:02:59 +0000
commit8c17d5921d4ea103d6b6109731808da425ab14be (patch)
treeea4c8462647de984ed9c6ffe7c6431cec47cb850 /llvm/lib/Support/Unix
parent3baae56a03bcfcbf109b37478dce244514abc19a (diff)
downloadbcm5719-llvm-8c17d5921d4ea103d6b6109731808da425ab14be.tar.gz
bcm5719-llvm-8c17d5921d4ea103d6b6109731808da425ab14be.zip
Add OpenBSD support to the Threading code
llvm-svn: 335426
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r--llvm/lib/Support/Unix/Threading.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc
index e4cccde2e58..2d49ce1ad74 100644
--- a/llvm/lib/Support/Unix/Threading.inc
+++ b/llvm/lib/Support/Unix/Threading.inc
@@ -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_name_length_impl() {
#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 &Name) {
::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",
OpenPOWER on IntegriCloud