diff options
| author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-25 14:32:06 +0000 |
|---|---|---|
| committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-25 14:32:06 +0000 |
| commit | 77dd3f9ea0b5b22de93614424e4bba7af004fc29 (patch) | |
| tree | 6ec2a59ca4054e8fa41b9c53ca40b3f48db54fc6 /libstdc++-v3/include/std/thread | |
| parent | d7fc9d10fc1c5f22fa8e627c6a57cb6507504b03 (diff) | |
| download | ppe42-gcc-77dd3f9ea0b5b22de93614424e4bba7af004fc29.tar.gz ppe42-gcc-77dd3f9ea0b5b22de93614424e4bba7af004fc29.zip | |
2011-05-25 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/thread: Use noexcept throughout per the FDIS.
* include/std/mutex: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174202 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/thread')
| -rw-r--r-- | libstdc++-v3/include/std/thread | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread index de58e814100..4fa5e505146 100644 --- a/libstdc++-v3/include/std/thread +++ b/libstdc++-v3/include/std/thread @@ -72,7 +72,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION native_handle_type _M_thread; public: - id() : _M_thread() { } + id() noexcept : _M_thread() { } explicit id(native_handle_type __id) : _M_thread(__id) { } @@ -82,11 +82,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION friend class hash<thread::id>; friend bool - operator==(thread::id __x, thread::id __y) + operator==(thread::id __x, thread::id __y) noexcept { return __gthread_equal(__x._M_thread, __y._M_thread); } friend bool - operator<(thread::id __x, thread::id __y) + operator<(thread::id __x, thread::id __y) noexcept { return __x._M_thread < __y._M_thread; } template<class _CharT, class _Traits> @@ -121,11 +121,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION id _M_id; public: - thread() = default; + thread() noexcept = default; thread(thread&) = delete; thread(const thread&) = delete; - thread(thread&& __t) + thread(thread&& __t) noexcept { swap(__t); } template<typename _Callable, typename... _Args> @@ -145,7 +145,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION thread& operator=(const thread&) = delete; - thread& operator=(thread&& __t) + thread& operator=(thread&& __t) noexcept { if (joinable()) std::terminate(); @@ -154,11 +154,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } void - swap(thread& __t) + swap(thread& __t) noexcept { std::swap(_M_id, __t._M_id); } bool - joinable() const + joinable() const noexcept { return !(_M_id == id()); } void @@ -168,7 +168,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION detach(); thread::id - get_id() const + get_id() const noexcept { return _M_id; } /** @pre thread is joinable @@ -179,7 +179,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Returns a value that hints at the number of hardware thread contexts. static unsigned int - hardware_concurrency() + hardware_concurrency() noexcept { return 0; } private: @@ -198,23 +198,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION inline thread::_Impl_base::~_Impl_base() = default; inline void - swap(thread& __x, thread& __y) + swap(thread& __x, thread& __y) noexcept { __x.swap(__y); } inline bool - operator!=(thread::id __x, thread::id __y) + operator!=(thread::id __x, thread::id __y) noexcept { return !(__x == __y); } inline bool - operator<=(thread::id __x, thread::id __y) + operator<=(thread::id __x, thread::id __y) noexcept { return !(__y < __x); } inline bool - operator>(thread::id __x, thread::id __y) + operator>(thread::id __x, thread::id __y) noexcept { return __y < __x; } inline bool - operator>=(thread::id __x, thread::id __y) + operator>=(thread::id __x, thread::id __y) noexcept { return !(__x < __y); } // DR 889. @@ -250,12 +250,12 @@ _GLIBCXX_END_NAMESPACE_VERSION /// get_id inline thread::id - get_id() { return thread::id(__gthread_self()); } + get_id() noexcept { return thread::id(__gthread_self()); } #ifdef _GLIBCXX_USE_SCHED_YIELD /// yield inline void - yield() + yield() noexcept { __gthread_yield(); } #endif |

