Add auto-increment option and accompanying test.

This allows for the threadpool to automatically grow if tasks
are pushed to it and no idle threads are currently available.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2012-12-11 16:34:00 +00:00
parent 29fc122783
commit 8760e32ae3
3 changed files with 109 additions and 7 deletions

View File

@@ -86,12 +86,23 @@ struct ast_threadpool_options {
#define AST_THREADPOOL_OPTIONS_VERSION 1
/*! Version of thradpool options in use */
int version;
/* !
/*!
* \brief Time limit in seconds for idle threads
*
* A time of 0 or less will mean an infinite timeout.
*/
int idle_timeout;
/*!
* \brief Number of threads to increment pool by
*
* If a task is added into a pool and no idle thread is
* available to activate, then the pool can automatically
* grow by the given amount.
*
* Zero is a perfectly valid value to give here if you want
* to control threadpool growth yourself via your listener.
*/
int auto_increment;
};
/*!