summaryrefslogtreecommitdiff
path: root/main/threadpool.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-01-15 21:09:55 +0000
committerMark Michelson <mmichelson@digium.com>2013-01-15 21:09:55 +0000
commit967e380ba88bf99bafe2922cf0a1fbf5f3d19192 (patch)
tree5b9d84120bd68d8facf1248258150e6df38af14e /main/threadpool.c
parent663479a558e2f2b98a94a9d77cf4c66f0e66e513 (diff)
Make the threadpool listener opaque.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/threadpool.c')
-rw-r--r--main/threadpool.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/main/threadpool.c b/main/threadpool.c
index 475a673fd..e27b05345 100644
--- a/main/threadpool.c
+++ b/main/threadpool.c
@@ -100,6 +100,20 @@ struct ast_threadpool {
};
/*!
+ * \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
*/
enum worker_state {
@@ -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;