From: Max Kellermann Date: Wed, 9 Oct 2024 12:14:00 +0000 (+0200) Subject: common/Finisher: merge duplicate field initializers X-Git-Tag: v20.0.0~789^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cdd9bbd51e591ad094112a2d5b7277d1fe20d348;p=ceph.git common/Finisher: merge duplicate field initializers Signed-off-by: Max Kellermann --- diff --git a/src/common/Finisher.h b/src/common/Finisher.h index 6618749b598..4cc5643efad 100644 --- a/src/common/Finisher.h +++ b/src/common/Finisher.h @@ -40,9 +40,9 @@ class Finisher { ceph::mutex finisher_lock; ///< Protects access to queues and finisher_running. ceph::condition_variable finisher_cond; ///< Signaled when there is something to process. ceph::condition_variable finisher_empty_cond; ///< Signaled when the finisher has nothing more to process. - bool finisher_stop; ///< Set when the finisher should stop. - bool finisher_running; ///< True when the finisher is currently executing contexts. - bool finisher_empty_wait; ///< True mean someone wait finisher empty. + bool finisher_stop = false; ///< Set when the finisher should stop. + bool finisher_running = false; ///< True when the finisher is currently executing contexts. + bool finisher_empty_wait = false; ///< True mean someone wait finisher empty. /// Queue for contexts for which complete(0) will be called. std::vector> finisher_queue; @@ -52,7 +52,7 @@ class Finisher { /// Performance counter for the finisher's queue length. /// Only active for named finishers. - PerfCounters *logger; + PerfCounters *logger = nullptr; void *finisher_thread_entry(); @@ -118,15 +118,13 @@ class Finisher { /// Anonymous finishers do not log their queue length. explicit Finisher(CephContext *cct_) : cct(cct_), finisher_lock(ceph::make_mutex("Finisher::finisher_lock")), - finisher_stop(false), finisher_running(false), finisher_empty_wait(false), - thread_name("fn_anonymous"), logger(0), + thread_name("fn_anonymous"), finisher_thread(this) {} /// Construct a named Finisher that logs its queue length. Finisher(CephContext *cct_, std::string name, std::string tn) : cct(cct_), finisher_lock(ceph::make_mutex("Finisher::" + name)), - finisher_stop(false), finisher_running(false), finisher_empty_wait(false), - thread_name(tn), logger(0), + thread_name(tn), finisher_thread(this) { PerfCountersBuilder b(cct, std::string("finisher-") + name, l_finisher_first, l_finisher_last);