threadpool, res_pjsip: Add serializer group shutdown API calls.

A module trying to unload needs to wait for all serializers it creates and
uses to complete processing before unloading.

ASTERISK-24907
Reported by: Kevin Harwell

Change-Id: I8c80b90f2f82754e8dbb02ddf3c9121e5e966059
This commit is contained in:
Richard Mudgett
2015-06-19 16:16:17 -05:00
parent 602c4b74b5
commit 84c12f9e0c
4 changed files with 207 additions and 11 deletions

View File

@@ -1112,6 +1112,23 @@ struct ast_sip_endpoint *ast_sip_get_artificial_endpoint(void);
*/
struct ast_taskprocessor *ast_sip_create_serializer(void);
struct ast_serializer_shutdown_group;
/*!
* \brief Create a new serializer for SIP tasks
* \since 13.5.0
*
* See \ref ast_threadpool_serializer for more information on serializers.
* SIP creates serializers so that tasks operating on similar data will run
* in sequence.
*
* \param shutdown_group Group shutdown controller. (NULL if no group association)
*
* \retval NULL Failure
* \retval non-NULL Newly-created serializer
*/
struct ast_taskprocessor *ast_sip_create_serializer_group(struct ast_serializer_shutdown_group *shutdown_group);
/*!
* \brief Set a serializer on a SIP dialog so requests and responses are automatically serialized
*