From: Kefu Chai Date: Tue, 22 Jun 2021 12:11:32 +0000 (+0800) Subject: crimson/os: replace private: section at end of class X-Git-Tag: v17.1.0~1579^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41986%2Fhead;p=ceph.git 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 --- diff --git a/src/crimson/os/alienstore/thread_pool.h b/src/crimson/os/alienstore/thread_pool.h index 6c22a49c5d4a..6b742a5cc83c 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