diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:52:30 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:52:30 +0000 |
commit | 243a6be085fe6a7ce49169864c68a8839735e49b (patch) | |
tree | abfecf3c23dc7512ca48e72ac418b149c865e0f3 /include/thread | |
parent | 1147845301c03308e3419b89c28c77bb6917fe04 (diff) | |
download | src-243a6be085fe6a7ce49169864c68a8839735e49b.tar.gz src-243a6be085fe6a7ce49169864c68a8839735e49b.zip |
Vendor import of stripped libc++ trunk r375505, the last commit beforevendor/libc++/libc++-trunk-r375505vendor/libc++
the upstream Subversion repository was made read-only, and the LLVM
project migrated to GitHub:
https://llvm.org/svn/llvm-project/libcxx/trunk@375505
Notes
Notes:
svn path=/vendor/libc++/dist/; revision=353946
svn path=/vendor/libc++/libc++-r375505/; revision=353947; tag=vendor/libc++/libc++-trunk-r375505
Diffstat (limited to 'include/thread')
-rw-r--r-- | include/thread | 78 |
1 files changed, 5 insertions, 73 deletions
diff --git a/include/thread b/include/thread index 3d8d2ac9ce50..02da703c3ccf 100644 --- a/include/thread +++ b/include/thread @@ -14,8 +14,6 @@ thread synopsis -#define __STDCPP_THREADS__ __cplusplus - namespace std { @@ -107,8 +105,6 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time); _LIBCPP_PUSH_MACROS #include <__undef_macros> -#define __STDCPP_THREADS__ __cplusplus - #ifdef _LIBCPP_HAS_NO_THREADS #error <thread> is not supported on this single threaded system #else // !_LIBCPP_HAS_NO_THREADS @@ -200,64 +196,6 @@ __thread_specific_ptr<_Tp>::set_pointer(pointer __p) __libcpp_tls_set(__key_, __p); } -class _LIBCPP_TYPE_VIS thread; -class _LIBCPP_TYPE_VIS __thread_id; - -namespace this_thread -{ - -_LIBCPP_INLINE_VISIBILITY __thread_id get_id() _NOEXCEPT; - -} // this_thread - -template<> struct hash<__thread_id>; - -class _LIBCPP_TEMPLATE_VIS __thread_id -{ - // FIXME: pthread_t is a pointer on Darwin but a long on Linux. - // NULL is the no-thread value on Darwin. Someone needs to check - // on other platforms. We assume 0 works everywhere for now. - __libcpp_thread_id __id_; - -public: - _LIBCPP_INLINE_VISIBILITY - __thread_id() _NOEXCEPT : __id_(0) {} - - friend _LIBCPP_INLINE_VISIBILITY - bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT - {return __libcpp_thread_id_equal(__x.__id_, __y.__id_);} - friend _LIBCPP_INLINE_VISIBILITY - bool operator!=(__thread_id __x, __thread_id __y) _NOEXCEPT - {return !(__x == __y);} - friend _LIBCPP_INLINE_VISIBILITY - bool operator< (__thread_id __x, __thread_id __y) _NOEXCEPT - {return __libcpp_thread_id_less(__x.__id_, __y.__id_);} - friend _LIBCPP_INLINE_VISIBILITY - bool operator<=(__thread_id __x, __thread_id __y) _NOEXCEPT - {return !(__y < __x);} - friend _LIBCPP_INLINE_VISIBILITY - bool operator> (__thread_id __x, __thread_id __y) _NOEXCEPT - {return __y < __x ;} - friend _LIBCPP_INLINE_VISIBILITY - bool operator>=(__thread_id __x, __thread_id __y) _NOEXCEPT - {return !(__x < __y);} - - template<class _CharT, class _Traits> - friend - _LIBCPP_INLINE_VISIBILITY - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id) - {return __os << __id.__id_;} - -private: - _LIBCPP_INLINE_VISIBILITY - __thread_id(__libcpp_thread_id __id) : __id_(__id) {} - - friend __thread_id this_thread::get_id() _NOEXCEPT; - friend class _LIBCPP_TYPE_VIS thread; - friend struct _LIBCPP_TEMPLATE_VIS hash<__thread_id>; -}; - template<> struct _LIBCPP_TEMPLATE_VIS hash<__thread_id> : public unary_function<__thread_id, size_t> @@ -269,17 +207,11 @@ struct _LIBCPP_TEMPLATE_VIS hash<__thread_id> } }; -namespace this_thread -{ - -inline _LIBCPP_INLINE_VISIBILITY -__thread_id -get_id() _NOEXCEPT -{ - return __libcpp_thread_get_current_id(); -} - -} // this_thread +template<class _CharT, class _Traits> +_LIBCPP_INLINE_VISIBILITY +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id) +{return __os << __id.__id_;} class _LIBCPP_TYPE_VIS thread { |