From db0124ef057d3e1ef499c47e7f58e939eb6624df Mon Sep 17 00:00:00 2001 From: Asias He Date: Thu, 11 Dec 2014 10:53:03 +0800 Subject: [PATCH] timer: Add now() for timer_set --- core/reactor.cc | 2 +- core/timer-set.hh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/reactor.cc b/core/reactor.cc index ff11a5ae09..8f06923712 100644 --- a/core/reactor.cc +++ b/core/reactor.cc @@ -335,7 +335,7 @@ future<> reactor_backend_epoll::timers_completed() { void reactor::complete_timers() { timers_completed().then( [this] () { - _expired_timers = _timers.expire(clock_type::now()); + _expired_timers = _timers.expire(_timers.now()); for (auto& t : _expired_timers) { t._expired = true; } diff --git a/core/timer-set.hh b/core/timer-set.hh index 53d1da91e4..236a5eee5a 100644 --- a/core/timer-set.hh +++ b/core/timer-set.hh @@ -237,6 +237,10 @@ public: { return _non_empty_buckets.none(); } + + time_point now() { + return Timer::clock::now(); + } }; #endif