diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/evloop/workqueue.c | 8 | ||||
-rw-r--r-- | src/lib/evloop/workqueue.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/evloop/workqueue.c b/src/lib/evloop/workqueue.c index 603dddd5a3..bc929148eb 100644 --- a/src/lib/evloop/workqueue.c +++ b/src/lib/evloop/workqueue.c @@ -672,3 +672,11 @@ replyqueue_process(replyqueue_t *queue) tor_mutex_release(&queue->lock); } + +/** Return the number of threads configured for the given pool. */ +unsigned int +threadpool_get_n_threads(threadpool_t *tp) +{ + tor_assert(tp); + return tp->n_threads; +} diff --git a/src/lib/evloop/workqueue.h b/src/lib/evloop/workqueue.h index 50391759bf..134fe7434f 100644 --- a/src/lib/evloop/workqueue.h +++ b/src/lib/evloop/workqueue.h @@ -65,5 +65,6 @@ void replyqueue_process(replyqueue_t *queue); int threadpool_register_reply_event(threadpool_t *tp, void (*cb)(threadpool_t *tp)); +unsigned int threadpool_get_n_threads(threadpool_t *tp); #endif /* !defined(TOR_WORKQUEUE_H) */ |