summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits/atomic_futex.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-12-04 13:22:31 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-12-04 13:22:31 +0000
commit7b48bf2011b4020c4a5a2d5d4149b03983f72cc2 (patch)
treeb07a064ee6bddbe6ddf73a98a9c131b5ab6a0f5f /libstdc++-v3/include/bits/atomic_futex.h
parent8cd167a5ad8baf4988e07fcbc9c9cc338c02d3d1 (diff)
downloadgcc-tarball-7b48bf2011b4020c4a5a2d5d4149b03983f72cc2.tar.gz
gcc-5.3.0gcc-5.3.0
Diffstat (limited to 'libstdc++-v3/include/bits/atomic_futex.h')
-rw-r--r--libstdc++-v3/include/bits/atomic_futex.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/libstdc++-v3/include/bits/atomic_futex.h b/libstdc++-v3/include/bits/atomic_futex.h
index ca3260d4ee..90317f2d01 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);
}