@@ -138,24 +138,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
void
- _M_do_wait(__platform_wait_t __version) noexcept
+ _M_do_wait(__platform_wait_t __old) noexcept
{
+ __platform_wait_t __cur;
+ __atomic_load(&_M_ver, &__cur, __ATOMIC_ACQUIRE);
+ while (__cur == __old)
+ {
#ifdef _GLIBCXX_HAVE_LINUX_FUTEX
- __platform_wait(&_M_ver, __version);
+ __platform_wait(&_M_ver, __cur);
#else
- __platform_wait_t __cur = 0;
- while (__cur <= __version)
- {
__waiters::__lock_t __l(_M_mtx);
auto __e = __gthread_cond_wait(&_M_cv, __l.mutex()->native_handle());
if (__e)
std::terminate();
- __platform_wait_t __last = __cur;
+#endif
__atomic_load(&_M_ver, &__cur, __ATOMIC_ACQUIRE);
- if (__cur < __last)
- break; // break the loop if version overflows
}
-#endif
}
__platform_wait_t