diff options
author | Mark Michelson <mmichelson@digium.com> | 2013-01-15 21:15:04 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2013-01-15 21:15:04 +0000 |
commit | a73d6e5b86cfeac94791874295743ae61504ccec (patch) | |
tree | 4eef852fa7e54e1a44fb4460dcbbaf1efcae5cb8 | |
parent | 967e380ba88bf99bafe2922cf0a1fbf5f3d19192 (diff) |
Add doxygen to accessors and increase refcount of taskprocessor before returning.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | include/asterisk/taskprocessor.h | 15 | ||||
-rw-r--r-- | include/asterisk/threadpool.h | 5 | ||||
-rw-r--r-- | main/taskprocessor.c | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/include/asterisk/taskprocessor.h b/include/asterisk/taskprocessor.h index a26cf4341..708b3d750 100644 --- a/include/asterisk/taskprocessor.h +++ b/include/asterisk/taskprocessor.h @@ -111,7 +111,22 @@ struct ast_taskprocessor_listener_callbacks { void (*shutdown)(struct ast_taskprocessor_listener *listener); }; +/*! + * \brief Get a reference to the listener's taskprocessor + * + * This will return the taskprocessor with its reference count increased. Release + * the reference to this object by using ast_taskprocessor_unreference() + * + * \param listener The listener that has the taskprocessor + * \return The taskprocessor + */ struct ast_taskprocessor *ast_taskprocessor_listener_get_tps(const struct ast_taskprocessor_listener *listener); + +/*! + * \brief Get the user data from the listener + * \param listener The taskprocessor listener + * \return The listener's user data + */ void *ast_taskprocessor_listener_get_user_data(const struct ast_taskprocessor_listener *listener); /*! diff --git a/include/asterisk/threadpool.h b/include/asterisk/threadpool.h index 51abc63c4..04daa9faa 100644 --- a/include/asterisk/threadpool.h +++ b/include/asterisk/threadpool.h @@ -114,6 +114,11 @@ struct ast_threadpool_options { struct ast_threadpool_listener *ast_threadpool_listener_alloc( const struct ast_threadpool_listener_callbacks *callbacks, void *user_data); +/*! + * \brief Get the threadpool listener's user data + * \param listener The threadpool listener + * \return The user data + */ void *ast_threadpool_listener_get_user_data(const struct ast_threadpool_listener *listener); /*! diff --git a/main/taskprocessor.c b/main/taskprocessor.c index 0b6a2a817..b603e5738 100644 --- a/main/taskprocessor.c +++ b/main/taskprocessor.c @@ -495,6 +495,7 @@ struct ast_taskprocessor_listener *ast_taskprocessor_listener_alloc(const struct struct ast_taskprocessor *ast_taskprocessor_listener_get_tps(const struct ast_taskprocessor_listener *listener) { + ao2_ref(listener->tps, +1); return listener->tps; } |