From 9bdbd4c0d3762e3dfa796ca20ad5c1bd0bb5c63a Mon Sep 17 00:00:00 2001 From: sageweil Date: Fri, 28 Sep 2007 21:03:06 +0000 Subject: [PATCH] subsecond add_event_after precision git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1853 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/common/Timer.cc | 6 +++--- trunk/ceph/common/Timer.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/trunk/ceph/common/Timer.cc b/trunk/ceph/common/Timer.cc index 2606ee344b117..1705bc759ac9f 100644 --- a/trunk/ceph/common/Timer.cc +++ b/trunk/ceph/common/Timer.cc @@ -184,11 +184,11 @@ void Timer::cancel_timer() */ -void Timer::add_event_after(float seconds, +void Timer::add_event_after(double seconds, Context *callback) { utime_t when = g_clock.now(); - when.sec_ref() += (int)seconds; + when += seconds; add_event_at(when, callback); } @@ -244,7 +244,7 @@ bool Timer::cancel_event(Context *callback) // ------------------------------- -void SafeTimer::add_event_after(float seconds, Context *c) +void SafeTimer::add_event_after(double seconds, Context *c) { assert(lock.is_locked()); Context *w = new EventWrapper(this, c); diff --git a/trunk/ceph/common/Timer.h b/trunk/ceph/common/Timer.h index 414ac3ad4e8eb..3574833c342c3 100644 --- a/trunk/ceph/common/Timer.h +++ b/trunk/ceph/common/Timer.h @@ -117,7 +117,7 @@ class Timer { } // schedule events - void add_event_after(float seconds, + void add_event_after(double seconds, Context *callback); void add_event_at(utime_t when, Context *callback); @@ -156,7 +156,7 @@ public: SafeTimer(Mutex& l) : lock(l) { } ~SafeTimer(); - void add_event_after(float seconds, Context *c); + void add_event_after(double seconds, Context *c); void add_event_at(utime_t when, Context *c); void cancel_event(Context *c); void cancel_all(); -- 2.39.5