summaryrefslogtreecommitdiffstats
path: root/libcxx/include/__threading_support
diff options
context:
space:
mode:
authorBen Craig <ben.craig@codeaurora.org>2016-05-25 17:40:09 +0000
committerBen Craig <ben.craig@codeaurora.org>2016-05-25 17:40:09 +0000
commitb9599b1b23178e05fc9abc4af8a381a9402da6af (patch)
tree736973369c801e24d232e7a9b54abcb0ebf46616 /libcxx/include/__threading_support
parentd85ac997b82651cf66aad4dae5bad14d2923cba1 (diff)
downloadbcm5719-llvm-b9599b1b23178e05fc9abc4af8a381a9402da6af.tar.gz
bcm5719-llvm-b9599b1b23178e05fc9abc4af8a381a9402da6af.zip
[libcxx] Allow explicit pthread opt-in
The existing pthread detection code in __config is pretty good for common operating systems. It doesn't allow cmake-time choices to be made for uncommon operating systems though. This change adds the LIBCXX_HAS_PTHREAD_API cmake flag, which turns into the _LIBCPP_HAS_THREAD_API_PTHREAD preprocessor define. This is a name change from the old _LIBCPP_THREAD_API_PTHREAD. The lit tests want __config_site.in variables to have a _LIBCPP_HAS prefix. http://reviews.llvm.org/D20573 llvm-svn: 270735
Diffstat (limited to 'libcxx/include/__threading_support')
-rw-r--r--libcxx/include/__threading_support6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support
index 49fdca27806..c9a4ea9d094 100644
--- a/libcxx/include/__threading_support
+++ b/libcxx/include/__threading_support
@@ -19,14 +19,14 @@
#ifndef _LIBCPP_HAS_NO_THREADS
-#if defined(_LIBCPP_THREAD_API_PTHREAD)
+#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
#include <pthread.h>
#include <sched.h>
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
-#if defined(_LIBCPP_THREAD_API_PTHREAD)
+#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
// Mutex
#define _LIBCPP_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
@@ -194,7 +194,7 @@ void __libcpp_tl_set(__libcpp_tl_key __key, void* __p)
pthread_setspecific(__key, __p);
}
-#else // !_LIBCPP_THREAD_API_PTHREAD
+#else // !_LIBCPP_HAS_THREAD_API_PTHREAD
#error "No thread API selected."
#endif
OpenPOWER on IntegriCloud