From: Samuel Just Date: Tue, 19 Aug 2025 15:19:17 +0000 (+0000) Subject: dmclock/src/dmclock_server: no need for PriorityQueueBase::cleaning_job to be a uniqu... X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b8b5a576e5b50968a8b1945dcf9de2d55a7f893;p=ceph.git dmclock/src/dmclock_server: no need for PriorityQueueBase::cleaning_job to be a unique_ptr Signed-off-by: Samuel Just --- diff --git a/src/dmclock/src/dmclock_server.h b/src/dmclock/src/dmclock_server.h index a8a168af2ca..3014199d071 100644 --- a/src/dmclock/src/dmclock_server.h +++ b/src/dmclock/src/dmclock_server.h @@ -826,7 +826,7 @@ namespace crimson { // NB: All threads declared at end, so they're destructed first! - std::unique_ptr cleaning_job; + RunEvery cleaning_job; // helper function to return the value of a variant if it matches the // given type T, or a default value of T otherwise @@ -852,16 +852,13 @@ namespace crimson { idle_age(std::chrono::duration_cast(_idle_age)), erase_age(std::chrono::duration_cast(_erase_age)), check_time(std::chrono::duration_cast(_check_time)), - erase_max(standard_erase_max) + erase_max(standard_erase_max), + cleaning_job(check_time, std::bind(&PriorityQueueBase::do_clean, this)) { assert(_erase_age >= _idle_age); assert(_check_time < _idle_age); // AtLimit::Reject depends on ImmediateTagCalc assert(at_limit != AtLimit::Reject || !IsDelayed); - cleaning_job = - std::unique_ptr( - new RunEvery(check_time, - std::bind(&PriorityQueueBase::do_clean, this))); } inline const ClientInfo* get_cli_info(ClientRec& client) const { @@ -1248,7 +1245,7 @@ namespace crimson { // clean finished, refresh last_erase_point = 0; } - cleaning_job->try_update(wperiod); + cleaning_job.try_update(wperiod); } // if } // do_clean