From 9600bd96d57ba2eb75fa64bc58602d1c591d24df Mon Sep 17 00:00:00 2001 From: lisyarus Date: Mon, 26 Dec 2022 14:06:23 +0300 Subject: [PATCH] Add async::threadpool::thread_count() --- libs/async/include/psemek/async/threadpool.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/async/include/psemek/async/threadpool.hpp b/libs/async/include/psemek/async/threadpool.hpp index 23419c81..381d3d1a 100644 --- a/libs/async/include/psemek/async/threadpool.hpp +++ b/libs/async/include/psemek/async/threadpool.hpp @@ -24,6 +24,8 @@ namespace psemek::async ~threadpool() override { stop(); } + std::size_t thread_count() const { return threads_.size(); } + void post(task t) override; void post_at(clock::time_point time, task t) override;