Use a single timerfd_manager for all timers

This commit is contained in:
Vitaliy Filippov
2020-04-25 01:35:49 +03:00
parent 4f42e9659e
commit 0f2b8dbf6f
3 changed files with 3 additions and 16 deletions
+2 -13
View File
@@ -42,13 +42,12 @@ osd_t::osd_t(blockstore_config_t & config, blockstore_t *bs, ring_loop_t *ringlo
throw std::runtime_error(std::string("epoll_create: ") + strerror(errno));
}
this->stats_tfd = new timerfd_interval(ringloop, print_stats_interval, [this]()
this->tfd = new timerfd_manager_t(ringloop);
this->tfd->set_timer(print_stats_interval*1000, true, [this](int timer_id)
{
print_stats();
});
this->tfd = new timerfd_manager_t(ringloop);
init_cluster();
consumer.loop = [this]() { loop(); };
@@ -62,16 +61,6 @@ osd_t::~osd_t()
delete tfd;
tfd = NULL;
}
if (stats_tfd)
{
delete stats_tfd;
stats_tfd = NULL;
}
if (sync_tfd)
{
delete sync_tfd;
sync_tfd = NULL;
}
ringloop->unregister_consumer(&consumer);
close(epoll_fd);
close(listen_fd);