summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/thread
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libc++/include/thread')
-rw-r--r--contrib/libc++/include/thread7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/libc++/include/thread b/contrib/libc++/include/thread
index 1f1e4a2..8a30102 100644
--- a/contrib/libc++/include/thread
+++ b/contrib/libc++/include/thread
@@ -99,6 +99,7 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
#include <tuple>
#endif
#include <pthread.h>
+#include <sched.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -106,6 +107,10 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
#define __STDCPP_THREADS__ __cplusplus
+#ifdef _LIBCPP_HAS_NO_THREADS
+#error <thread> is not supported on this single threaded system
+#else // !_LIBCPP_HAS_NO_THREADS
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
@@ -455,4 +460,6 @@ void yield() _NOEXCEPT {sched_yield();}
_LIBCPP_END_NAMESPACE_STD
+#endif // !_LIBCPP_HAS_NO_THREADS
+
#endif // _LIBCPP_THREAD
OpenPOWER on IntegriCloud