From e78cf1d375ce0dc821f0591fc686162d1b9ab525 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 22 Jun 2021 20:11:32 +0800 Subject: [PATCH] crimson/os: replace private: section at end of class to comply to the style guide at https://google.github.io/styleguide/cppguide.html#Declaration_Order Signed-off-by: Kefu Chai --- src/crimson/os/alienstore/thread_pool.h | 39 +++++++++++++------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/crimson/os/alienstore/thread_pool.h b/src/crimson/os/alienstore/thread_pool.h index 6c22a49c5d4a9..6b742a5cc83c3 100644 --- a/src/crimson/os/alienstore/thread_pool.h +++ b/src/crimson/os/alienstore/thread_pool.h @@ -114,24 +114,6 @@ private: /// an engine for scheduling non-seastar tasks from seastar fibers class ThreadPool { - size_t n_threads; - std::atomic stopping = false; - std::vector threads; - seastar::sharded submit_queue; - const size_t queue_size; - std::vector 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& 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)); } + +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& 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 stopping = false; + std::vector threads; + seastar::sharded submit_queue; + const size_t queue_size; + std::vector pending_queues; }; } // namespace crimson::os -- 2.39.5