easier to use when we are moving from the number of seconds to a
C++ timespan.
Signed-off-by: Kefu Chai <kchai@redhat.com>
}
Context* SafeTimer::add_event_after(double seconds, Context *callback)
+{
+ return add_event_after(ceph::make_timespan(seconds), callback);
+}
+
+Context* SafeTimer::add_event_after(ceph::timespan duration, Context *callback)
{
ceph_assert(ceph_mutex_is_locked(lock));
- auto when = clock_t::now() + ceph::make_timespan(seconds);
+ auto when = clock_t::now() + duration;
return add_event_at(when, callback);
}
/* Schedule an event in the future
* Call with the event_lock LOCKED */
+ Context* add_event_after(ceph::timespan duration, Context *callback);
Context* add_event_after(double seconds, Context *callback);
Context* add_event_at(clock_t::time_point when, Context *callback);