summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-03 15:10:37 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-03 15:10:37 +0000
commit193ec5f314c65ed73e56c4e1b7e05512968e59df (patch)
tree4efdc15dcf8dc8e9c469e6a428586f0ad5a5bd64 /libstdc++-v3
parentc1bddff3cce117096fa1cf96d83524da0ffafcdc (diff)
downloadgcc-193ec5f314c65ed73e56c4e1b7e05512968e59df.tar.gz
Backport atomic_futex.h warning fix from mainline
2015-07-24 Jonathan Wakely <jwakely@redhat.com> * include/bits/atomic_futex.h [_GLIBCXX_HAVE_LINUX_FUTEX] (_M_load_and_test_until): Whitespace. (_M_load_and_test): Value-initialize the unused durations. (_M_load_when_equal): Add missing return value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@227453 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/bits/atomic_futex.h15
2 files changed, 16 insertions, 7 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 38de3d096c7..1d674a1dd29 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,6 +1,14 @@
2015-09-03 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline
+ 2015-07-24 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/atomic_futex.h [_GLIBCXX_HAVE_LINUX_FUTEX]
+ (_M_load_and_test_until): Whitespace.
+ (_M_load_and_test): Value-initialize the unused durations.
+ (_M_load_when_equal): Add missing return value.
+
+ Backport from mainline
2015-07-13 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/66855
diff --git a/libstdc++-v3/include/bits/atomic_futex.h b/libstdc++-v3/include/bits/atomic_futex.h
index ca3260d4ee2..90317f2d013 100644
--- a/libstdc++-v3/include/bits/atomic_futex.h
+++ b/libstdc++-v3/include/bits/atomic_futex.h
@@ -93,15 +93,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
for (;;)
{
- // Don't bother checking the value again because we expect the caller to
- // have done it recently.
+ // Don't bother checking the value again because we expect the caller
+ // to have done it recently.
// memory_order_relaxed is sufficient because we can rely on just the
// modification order (store_notify uses an atomic RMW operation too),
// and the futex syscalls synchronize between themselves.
_M_data.fetch_or(_Waiter_bit, memory_order_relaxed);
- bool __ret;
- __ret = _M_futex_wait_until((unsigned*)(void*)&_M_data,
- __assumed | _Waiter_bit, __has_timeout, __s, __ns);
+ bool __ret = _M_futex_wait_until((unsigned*)(void*)&_M_data,
+ __assumed | _Waiter_bit,
+ __has_timeout, __s, __ns);
// Fetch the current value after waiting (clears _Waiter_bit).
__assumed = _M_load(__mo);
if (!__ret || ((__operand == __assumed) == __equal))
@@ -119,7 +119,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool __equal, memory_order __mo)
{
return _M_load_and_test_until(__assumed, __operand, __equal, __mo,
- false, chrono::seconds(0), chrono::nanoseconds(0));
+ false, {}, {});
}
// If a timeout occurs, returns a current value after the timeout;
@@ -146,7 +146,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_load_when_not_equal(unsigned __val, memory_order __mo)
{
unsigned __i = _M_load(__mo);
- if ((__i & ~_Waiter_bit) != __val) return;
+ if ((__i & ~_Waiter_bit) != __val)
+ return (__i & ~_Waiter_bit);
// TODO Spin-wait first.
return _M_load_and_test(__i, __val, false, __mo);
}