}
ldout(m_cct, 20) << __func__ << ": " << m_oid << " scheduling watch" << dendl;
- assert(m_watch_task == NULL);
- m_watch_task = new C_WatchTask(this);
- m_timer.add_event_after(m_watch_interval, m_watch_task);
+ assert(m_watch_task == nullptr);
+ m_watch_task = m_timer.add_event_after(
+ m_watch_interval,
+ new FunctionContext([this](int) {
+ handle_watch_task();
+ }));
}
bool ObjectPlayer::cancel_watch() {
on_finish->complete(r);
}
-void ObjectPlayer::C_WatchTask::finish(int r) {
- object_player->handle_watch_task();
-}
-
void ObjectPlayer::C_WatchFetch::finish(int r) {
object_player->handle_watch_fetched(r);
}