diff options
author | David Goulet <dgoulet@torproject.org> | 2022-11-23 14:54:43 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2022-11-23 14:54:43 -0500 |
commit | 04d87536764f17267b88cb35106bc468020dcc65 (patch) | |
tree | ad0489ff586e3e6b12693a659a08a13bd843b17e /src/lib | |
parent | 8713d9762a79c46829891cafbcf1a972f0946065 (diff) | |
parent | fbc9e92fdb364a741a3190fc22c6fa65d90e92e3 (diff) | |
download | tor-04d87536764f17267b88cb35106bc468020dcc65.tar.gz tor-04d87536764f17267b88cb35106bc468020dcc65.zip |
Merge branch 'maint-0.4.7'
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) */ |