Skip to content

Commit a1e7ef6

Browse files
committed
common/Finisher: add const to several fields
These are never changed; `const` prevents accidental changes and allows further compiler optimizations. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
1 parent cdd9bbd commit a1e7ef6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/Finisher.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ enum {
3636
* contexts to complete is thread-safe.
3737
*/
3838
class Finisher {
39-
CephContext *cct;
39+
CephContext *const cct;
4040
ceph::mutex finisher_lock; ///< Protects access to queues and finisher_running.
4141
ceph::condition_variable finisher_cond; ///< Signaled when there is something to process.
4242
ceph::condition_variable finisher_empty_cond; ///< Signaled when the finisher has nothing more to process.
@@ -48,7 +48,7 @@ class Finisher {
4848
std::vector<std::pair<Context*,int>> finisher_queue;
4949
std::vector<std::pair<Context*,int>> in_progress_queue;
5050

51-
std::string thread_name;
51+
const std::string thread_name;
5252

5353
/// Performance counter for the finisher's queue length.
5454
/// Only active for named finishers.

0 commit comments

Comments
 (0)