summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
authorAsiri Rathnayake <asiri.rathnayake@arm.com>2016-10-14 13:00:07 +0000
committerAsiri Rathnayake <asiri.rathnayake@arm.com>2016-10-14 13:00:07 +0000
commit81c0be3f561b1db2947dd2ff84059a25a43bf71b (patch)
tree82eec2752f7d8551c513952bf2d5f20905e4f55d /libcxx/include
parent4b7bb3cc96ac68691f6423cebd6482bfdde03735 (diff)
downloadbcm5719-llvm-81c0be3f561b1db2947dd2ff84059a25a43bf71b.tar.gz
bcm5719-llvm-81c0be3f561b1db2947dd2ff84059a25a43bf71b.zip
[libcxx] Do not declare the thread api when __external_threading is present
This fixes a small omission where even when __external_threading is provided, we attempt to declare a pthread based threading API. Instead, we should leave out everything for the __external_threading header to take care of. The __threading_support header provides a proof-of-concept externally threaded libc++ variant when _LIBCPP_HAS_THREAD_API_EXTERNAL is defined. But if the __external_threading header is present, we should exclude all of that POC stuff. Reviewers: EricWF Differential revision: https://reviews.llvm.org/D25468 llvm-svn: 284232
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/__threading_support9
1 files changed, 5 insertions, 4 deletions
diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support
index 86dc8c7be82..af3109efd46 100644
--- a/libcxx/include/__threading_support
+++ b/libcxx/include/__threading_support
@@ -25,17 +25,16 @@
#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
#if !defined(__clang__) && (_GNUC_VER < 500)
#include <__external_threading>
-#define _LIBCPP_EXTERNAL_THREADING
+#define _LIBCPP_HAS_EXTERNAL_THREADING_HEADER
#elif !defined(__has_include) || __has_include(<__external_threading>)
#include <__external_threading>
-#define _LIBCPP_EXTERNAL_THREADING
+#define _LIBCPP_HAS_EXTERNAL_THREADING_HEADER
#endif
#endif
-#if !defined(_LIBCPP_EXTERNAL_THREADING)
+#if !defined(_LIBCPP_HAS_EXTERNAL_THREADING_HEADER)
#include <pthread.h>
#include <sched.h>
-#endif
#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
#define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS
@@ -242,6 +241,8 @@ void __libcpp_tls_set(__libcpp_tls_key __key, void* __p)
_LIBCPP_END_NAMESPACE_STD
+#endif // !_LIBCPP_HAS_EXTERNAL_THREADING_HEADER
+
#endif // _LIBCPP_HAS_NO_THREADS
#endif // _LIBCPP_THREADING_SUPPORT
OpenPOWER on IntegriCloud