diff --git a/ostd/build/make.hh b/ostd/build/make.hh index d5fe1c1..cfb2de6 100644 --- a/ostd/build/make.hh +++ b/ostd/build/make.hh @@ -251,6 +251,10 @@ struct make { return p_rules.back(); } + unsigned int threads() const noexcept { + return p_tpool.threads(); + } + private: struct rule_inst { diff --git a/ostd/thread_pool.hh b/ostd/thread_pool.hh index 6a573d8..4e2dbe5 100644 --- a/ostd/thread_pool.hh +++ b/ostd/thread_pool.hh @@ -196,6 +196,11 @@ struct thread_pool { return ret; } + /** @brief Gets the number of threads in the pool. */ + unsigned int threads() const noexcept { + return p_thrs.size(); + } + private: void thread_run() { for (;;) {