aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2016-10-11 11:33:16 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2016-10-11 11:33:16 +0100
commit2c15eace95fe78182e9fcaa736c06ed73878d7e9 (patch)
treec6f4e1e3fcb2c58d6ac242ee3c7171d3b20e1b76
parente7b08761c704a9e5a64d545983b46f705612f3d4 (diff)
downloadgcc-2c15eace95fe78182e9fcaa736c06ed73878d7e9.zip
gcc-2c15eace95fe78182e9fcaa736c06ed73878d7e9.tar.gz
gcc-2c15eace95fe78182e9fcaa736c06ed73878d7e9.tar.bz2
More noexcept for standard mutex types and locks
* include/bits/std_mutex.h (mutex::native_handle) (lock_guard(mutex_type&, adopt_lock_t) (unique_lock(mutex_type&, adopt_lock_t): Add noexcept. * include/std/mutex (recursive_mutex, timed_mutex) (recursive_timed_mutex): Likewise. From-SVN: r240980
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/bits/std_mutex.h6
-rw-r--r--libstdc++-v3/include/std/mutex6
3 files changed, 14 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5016ca7..7743e09 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2016-10-11 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/std_mutex.h (mutex::native_handle)
+ (lock_guard(mutex_type&, adopt_lock_t)
+ (unique_lock(mutex_type&, adopt_lock_t): Add noexcept.
+ * include/std/mutex (recursive_mutex, timed_mutex)
+ (recursive_timed_mutex): Likewise.
+
2016-10-10 Jonathan Wakely <jwakely@redhat.com>
* doc/xml/manual/appendix_contributing.xml (contrib.organization):
diff --git a/libstdc++-v3/include/bits/std_mutex.h b/libstdc++-v3/include/bits/std_mutex.h
index 49ef752..ad43841 100644
--- a/libstdc++-v3/include/bits/std_mutex.h
+++ b/libstdc++-v3/include/bits/std_mutex.h
@@ -122,7 +122,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
native_handle_type
- native_handle()
+ native_handle() noexcept
{ return &_M_mutex; }
};
@@ -161,7 +161,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit lock_guard(mutex_type& __m) : _M_device(__m)
{ _M_device.lock(); }
- lock_guard(mutex_type& __m, adopt_lock_t) : _M_device(__m)
+ lock_guard(mutex_type& __m, adopt_lock_t) noexcept : _M_device(__m)
{ } // calling thread owns mutex
~lock_guard()
@@ -206,7 +206,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: _M_device(std::__addressof(__m)), _M_owns(_M_device->try_lock())
{ }
- unique_lock(mutex_type& __m, adopt_lock_t)
+ unique_lock(mutex_type& __m, adopt_lock_t) noexcept
: _M_device(std::__addressof(__m)), _M_owns(true)
{
// XXX calling thread owns mutex
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index 1f4da57..7a7bd2e 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -124,7 +124,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
native_handle_type
- native_handle()
+ native_handle() noexcept
{ return &_M_mutex; }
};
@@ -219,7 +219,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
native_handle_type
- native_handle()
+ native_handle() noexcept
{ return &_M_mutex; }
private:
@@ -279,7 +279,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
native_handle_type
- native_handle()
+ native_handle() noexcept
{ return &_M_mutex; }
private: