Make the threadpool listener opaque.

git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2013-01-15 21:09:55 +00:00
parent 663479a558
commit 967e380ba8
3 changed files with 27 additions and 20 deletions

View File

@@ -99,6 +99,20 @@ struct ast_threadpool {
struct ast_threadpool_options options;
};
/*!
* \brief listener for a threadpool
*
* The listener is notified of changes in a threadpool. It can
* react by doing things like increasing the number of threads
* in the pool
*/
struct ast_threadpool_listener {
/*! Callbacks called by the threadpool */
const struct ast_threadpool_listener_callbacks *callbacks;
/*! User data for the listener */
void *user_data;
};
/*!
* \brief states for worker threads
*/
@@ -823,6 +837,11 @@ struct ast_threadpool_listener *ast_threadpool_listener_alloc(
return listener;
}
void *ast_threadpool_listener_get_user_data(const struct ast_threadpool_listener *listener)
{
return listener->user_data;
}
struct pool_options_pair {
struct ast_threadpool *pool;
struct ast_threadpool_options options;