add API to get the number of threads in a threadpool
parent
230ece9fb6
commit
097722b1ed
|
@ -251,6 +251,10 @@ struct make {
|
||||||
return p_rules.back();
|
return p_rules.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int threads() const noexcept {
|
||||||
|
return p_tpool.threads();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
struct rule_inst {
|
struct rule_inst {
|
||||||
|
|
|
@ -196,6 +196,11 @@ struct thread_pool {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Gets the number of threads in the pool. */
|
||||||
|
unsigned int threads() const noexcept {
|
||||||
|
return p_thrs.size();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void thread_run() {
|
void thread_run() {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
Loading…
Reference in New Issue