forked from OSchip/llvm-project
[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
This commit is contained in:
parent
4b7bb3cc96
commit
81c0be3f56
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue