X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fcommon%2FTimer.cc;h=45305f553fa6c80ed45e23fd94a36ff598b68444;hb=3efd99882e8c73385040d3f5c48fd014e4247be7;hp=f211a6f8ff8c2171f4921f326ac451e5c82cc283;hpb=1a629971a9bcaaae99e5539a3a43f800a297f267;p=ceph.git diff --git a/ceph/src/common/Timer.cc b/ceph/src/common/Timer.cc index f211a6f8f..45305f553 100644 --- a/ceph/src/common/Timer.cc +++ b/ceph/src/common/Timer.cc @@ -114,7 +114,7 @@ void SafeTimer::timer_thread() lock.Unlock(); } -bool SafeTimer::add_event_after(double seconds, Context *callback) +Context* SafeTimer::add_event_after(double seconds, Context *callback) { assert(lock.is_locked()); @@ -123,14 +123,14 @@ bool SafeTimer::add_event_after(double seconds, Context *callback) return add_event_at(when, callback); } -bool SafeTimer::add_event_at(utime_t when, Context *callback) +Context* SafeTimer::add_event_at(utime_t when, Context *callback) { assert(lock.is_locked()); ldout(cct,10) << __func__ << " " << when << " -> " << callback << dendl; if (stopping) { ldout(cct,5) << __func__ << " already shutdown, event not added" << dendl; delete callback; - return false; + return nullptr; } scheduled_map_t::value_type s_val(when, callback); scheduled_map_t::iterator i = schedule.insert(s_val); @@ -145,7 +145,7 @@ bool SafeTimer::add_event_at(utime_t when, Context *callback) * adjust our timeout. */ if (i == schedule.begin()) cond.Signal(); - return true; + return callback; } bool SafeTimer::cancel_event(Context *callback)