summaryrefslogtreecommitdiff
path: root/include/asterisk/threadpool.h
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-01-15 19:44:25 +0000
committerMark Michelson <mmichelson@digium.com>2013-01-15 19:44:25 +0000
commitc6bc51ef28a79303500ab541684e8adc331cc662 (patch)
tree47eec8e82823f419b3179a25517721f250c97ab4 /include/asterisk/threadpool.h
parentedc2e4dac0a6d532957fd27b6b784232cf2ae55c (diff)
Make the initial size of the threadpool part of the options passed in.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/threadpool.h')
-rw-r--r--include/asterisk/threadpool.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/asterisk/threadpool.h b/include/asterisk/threadpool.h
index 5cc4ea4da..a549ae3e1 100644
--- a/include/asterisk/threadpool.h
+++ b/include/asterisk/threadpool.h
@@ -102,6 +102,16 @@ struct ast_threadpool_options {
* to control threadpool growth yourself via your listener.
*/
int auto_increment;
+ /*!
+ * \brief Number of threads the pool will start with
+ *
+ * When the threadpool is allocated, it will immediately size
+ * itself to have this number of threads in it.
+ *
+ * Zero is a valid value if the threadpool should start
+ * without any threads allocated.
+ */
+ int initial_size;
};
/*!
@@ -126,13 +136,13 @@ struct ast_threadpool_listener *ast_threadpool_listener_alloc(
*
* \param name The name for the threadpool
* \param listener The listener the threadpool will notify of changes
- * \param initial_size The number of threads for the pool to start with
+ * \param options The behavioral options for this threadpool
* \retval NULL Failed to create the threadpool
* \retval non-NULL The newly-created threadpool
*/
struct ast_threadpool *ast_threadpool_create(const char *name,
struct ast_threadpool_listener *listener,
- int initial_size, const struct ast_threadpool_options *options);
+ const struct ast_threadpool_options *options);
/*!
* \brief Set the number of threads for the thread pool