summaryrefslogtreecommitdiff
path: root/libcxx/include/thread
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
commitcfca06d7963fa0909f90483b42a6d7d194d01e08 (patch)
tree209fb2a2d68f8f277793fc8df46c753d31bc853b /libcxx/include/thread
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'libcxx/include/thread')
-rw-r--r--libcxx/include/thread30
1 files changed, 13 insertions, 17 deletions
diff --git a/libcxx/include/thread b/libcxx/include/thread
index 3b55342288d1..6eff1800acdb 100644
--- a/libcxx/include/thread
+++ b/libcxx/include/thread
@@ -241,12 +241,19 @@ public:
#endif
~thread();
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) {__t.__t_ = _LIBCPP_NULL_THREAD;}
+ thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) {
+ __t.__t_ = _LIBCPP_NULL_THREAD;
+ }
+
_LIBCPP_INLINE_VISIBILITY
- thread& operator=(thread&& __t) _NOEXCEPT;
-#endif // _LIBCPP_CXX03_LANG
+ thread& operator=(thread&& __t) _NOEXCEPT {
+ if (!__libcpp_thread_isnull(&__t_))
+ terminate();
+ __t_ = __t.__t_;
+ __t.__t_ = _LIBCPP_NULL_THREAD;
+ return *this;
+ }
_LIBCPP_INLINE_VISIBILITY
void swap(thread& __t) _NOEXCEPT {_VSTD::swap(__t_, __t.__t_);}
@@ -304,17 +311,6 @@ thread::thread(_Fp&& __f, _Args&&... __args)
__throw_system_error(__ec, "thread constructor failed");
}
-inline
-thread&
-thread::operator=(thread&& __t) _NOEXCEPT
-{
- if (!__libcpp_thread_isnull(&__t_))
- terminate();
- __t_ = __t.__t_;
- __t.__t_ = _LIBCPP_NULL_THREAD;
- return *this;
-}
-
#else // _LIBCPP_CXX03_LANG
template <class _Fp>
@@ -369,9 +365,9 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d)
{
#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
// GCC's long double const folding is incomplete for IBM128 long doubles.
- _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
-#else
_LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
+#else
+ _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
#endif
nanoseconds __ns;
if (__d < _Max)