diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-07 21:08:01 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-07 21:08:01 +0000 |
| commit | f857581820d15e410e9945d2fcd5f7163be25a96 (patch) | |
| tree | 41f38760e19d47a9e21d0f64ece2bddaaab8aaf7 /include/thread | |
| parent | a5b2dbc259e289ea23fe9aebb34eba2c1dc7fefb (diff) | |
Notes
Diffstat (limited to 'include/thread')
| -rw-r--r-- | include/thread | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/thread b/include/thread index 1f1e4a2b9459..8a30102f427e 100644 --- a/include/thread +++ b/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 |
