diff --git a/include/thread b/include/thread index 23b19158..b6b70003 100644 --- a/include/thread +++ b/include/thread @@ -26,41 +26,41 @@ public: class id; typedef pthread_t native_handle_type; - thread(); + thread() noexcept; template explicit thread(F&& f, Args&&... args); ~thread(); thread(const thread&) = delete; - thread(thread&& t); + thread(thread&& t) noexcept; thread& operator=(const thread&) = delete; - thread& operator=(thread&& t); + thread& operator=(thread&& t) noexcept; - void swap(thread& t); + void swap(thread& t) noexcept; - bool joinable() const; + bool joinable() const noexcept; void join(); void detach(); - id get_id() const; + id get_id() const noexcept; native_handle_type native_handle(); - static unsigned hardware_concurrency(); + static unsigned hardware_concurrency() noexcept; }; -void swap(thread& x, thread& y); +void swap(thread& x, thread& y) noexcept; class thread::id { public: - id(); + id() noexcept; }; -bool operator==(thread::id x, thread::id y); -bool operator!=(thread::id x, thread::id y); -bool operator< (thread::id x, thread::id y); -bool operator<=(thread::id x, thread::id y); -bool operator> (thread::id x, thread::id y); -bool operator>=(thread::id x, thread::id y); +bool operator==(thread::id x, thread::id y) noexcept; +bool operator!=(thread::id x, thread::id y) noexcept; +bool operator< (thread::id x, thread::id y) noexcept; +bool operator<=(thread::id x, thread::id y) noexcept; +bool operator> (thread::id x, thread::id y) noexcept; +bool operator>=(thread::id x, thread::id y) noexcept; template basic_ostream& @@ -69,9 +69,9 @@ operator<<(basic_ostream& out, thread::id id); namespace this_thread { -thread::id get_id(); +thread::id get_id() noexcept; -void yield(); +void yield() noexcept; template void sleep_until(const chrono::time_point& abs_time); @@ -179,7 +179,7 @@ class __thread_id; namespace this_thread { -__thread_id get_id(); +__thread_id get_id() _NOEXCEPT; } // this_thread @@ -195,25 +195,25 @@ class _LIBCPP_VISIBLE __thread_id public: _LIBCPP_INLINE_VISIBILITY - __thread_id() : __id_(0) {} + __thread_id() _NOEXCEPT : __id_(0) {} friend _LIBCPP_INLINE_VISIBILITY - bool operator==(__thread_id __x, __thread_id __y) + bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT {return __x.__id_ == __y.__id_;} friend _LIBCPP_INLINE_VISIBILITY - bool operator!=(__thread_id __x, __thread_id __y) + bool operator!=(__thread_id __x, __thread_id __y) _NOEXCEPT {return !(__x == __y);} friend _LIBCPP_INLINE_VISIBILITY - bool operator< (__thread_id __x, __thread_id __y) + bool operator< (__thread_id __x, __thread_id __y) _NOEXCEPT {return __x.__id_ < __y.__id_;} friend _LIBCPP_INLINE_VISIBILITY - bool operator<=(__thread_id __x, __thread_id __y) + bool operator<=(__thread_id __x, __thread_id __y) _NOEXCEPT {return !(__y < __x);} friend _LIBCPP_INLINE_VISIBILITY - bool operator> (__thread_id __x, __thread_id __y) + bool operator> (__thread_id __x, __thread_id __y) _NOEXCEPT {return __y < __x ;} friend _LIBCPP_INLINE_VISIBILITY - bool operator>=(__thread_id __x, __thread_id __y) + bool operator>=(__thread_id __x, __thread_id __y) _NOEXCEPT {return !(__x < __y);} template @@ -248,7 +248,7 @@ namespace this_thread inline _LIBCPP_INLINE_VISIBILITY __thread_id -get_id() +get_id() _NOEXCEPT { return pthread_self(); } @@ -266,7 +266,7 @@ public: typedef pthread_t native_handle_type; _LIBCPP_INLINE_VISIBILITY - thread() : __t_(0) {} + thread() _NOEXCEPT : __t_(0) {} #ifndef _LIBCPP_HAS_NO_VARIADICS template & __t) } inline _LIBCPP_INLINE_VISIBILITY -void yield() {sched_yield();} +void yield() _NOEXCEPT {sched_yield();} } // this_thread diff --git a/src/thread.cpp b/src/thread.cpp index f27136a5..ffcbe0ab 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -52,7 +52,7 @@ thread::detach() } unsigned -thread::hardware_concurrency() +thread::hardware_concurrency() _NOEXCEPT { #if defined(CTL_HW) && defined(HW_NCPU) unsigned n;