]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os: replace private: section at end of class 41986/head
authorKefu Chai <kchai@redhat.com>
Tue, 22 Jun 2021 12:11:32 +0000 (20:11 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 23 Jun 2021 09:08:58 +0000 (17:08 +0800)
to comply to the style guide at https://google.github.io/styleguide/cppguide.html#Declaration_Order

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/alienstore/thread_pool.h

index 6c22a49c5d4a98842ac61de4f93ff3b51eac26f5..6b742a5cc83c3579e63cfbace6c05012d7ac6136 100644 (file)
@@ -114,24 +114,6 @@ private:
 
 /// an engine for scheduling non-seastar tasks from seastar fibers
 class ThreadPool {
-  size_t n_threads;
-  std::atomic<bool> stopping = false;
-  std::vector<std::thread> threads;
-  seastar::sharded<SubmitQueue> submit_queue;
-  const size_t queue_size;
-  std::vector<ShardedWorkQueue> pending_queues;
-
-  void loop(std::chrono::milliseconds queue_max_wait, size_t shard);
-  bool is_stopping() const {
-    return stopping.load(std::memory_order_relaxed);
-  }
-  static void pin(const std::vector<uint64_t>& cpus);
-  static void block_sighup();
-  seastar::semaphore& local_free_slots() {
-    return submit_queue.local().free_slots;
-  }
-  ThreadPool(const ThreadPool&) = delete;
-  ThreadPool& operator=(const ThreadPool&) = delete;
 public:
   /**
    * @param queue_sz the depth of pending queue. before a task is scheduled,
@@ -174,6 +156,27 @@ public:
   auto submit(Func&& func) {
     return submit(::rand() % n_threads, std::forward<Func>(func));
   }
+
+private:
+  void loop(std::chrono::milliseconds queue_max_wait, size_t shard);
+  bool is_stopping() const {
+    return stopping.load(std::memory_order_relaxed);
+  }
+  static void pin(const std::vector<uint64_t>& cpus);
+  static void block_sighup();
+  seastar::semaphore& local_free_slots() {
+    return submit_queue.local().free_slots;
+  }
+  ThreadPool(const ThreadPool&) = delete;
+  ThreadPool& operator=(const ThreadPool&) = delete;
+
+private:
+  size_t n_threads;
+  std::atomic<bool> stopping = false;
+  std::vector<std::thread> threads;
+  seastar::sharded<SubmitQueue> submit_queue;
+  const size_t queue_size;
+  std::vector<ShardedWorkQueue> pending_queues;
 };
 
 } // namespace crimson::os