+2018-08-01 Mike Crowe <mac@mcrowe.com>
+
+ * include/std/condition_variable (wait_for): Use steady_clock.
+
2018-08-01 Mike Crowe <mac@mcrowe.com>
* include/std/condition_variable (wait_until): Only report timeout
class condition_variable
{
typedef chrono::system_clock __clock_t;
+ typedef chrono::steady_clock __steady_clock_t;
typedef __gthread_cond_t __native_type;
#ifdef __GTHREAD_COND_INIT
wait_for(unique_lock<mutex>& __lock,
const chrono::duration<_Rep, _Period>& __rtime)
{
- using __dur = typename __clock_t::duration;
+ using __dur = typename __steady_clock_t::duration;
auto __reltime = chrono::duration_cast<__dur>(__rtime);
if (__reltime < __rtime)
++__reltime;
- return wait_until(__lock, __clock_t::now() + __reltime);
+ return wait_until(__lock, __steady_clock_t::now() + __reltime);
}
template<typename _Rep, typename _Period, typename _Predicate>