summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2015-06-19 16:16:17 -0500
committerRichard Mudgett <rmudgett@digium.com>2015-06-25 14:37:08 -0500
commit84c12f9e0c810c4816444dbd2bb8a6f4e5bfc1f9 (patch)
treec3776dc24ebfcc8aaa10893537d01de9544997d4 /res
parent602c4b74b500fb6fbe3ae3f6e13d2502edbdd56c (diff)
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
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 27e3f8179..170298105 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3322,20 +3322,25 @@ int ast_sip_append_body(pjsip_tx_data *tdata, const char *body_text)
return 0;
}
-struct ast_taskprocessor *ast_sip_create_serializer(void)
+struct ast_taskprocessor *ast_sip_create_serializer_group(struct ast_serializer_shutdown_group *shutdown_group)
{
struct ast_taskprocessor *serializer;
char name[AST_UUID_STR_LEN];
ast_uuid_generate_str(name, sizeof(name));
- serializer = ast_threadpool_serializer(name, sip_threadpool);
+ serializer = ast_threadpool_serializer_group(name, sip_threadpool, shutdown_group);
if (!serializer) {
return NULL;
}
return serializer;
}
+struct ast_taskprocessor *ast_sip_create_serializer(void)
+{
+ return ast_sip_create_serializer_group(NULL);
+}
+
int ast_sip_push_task(struct ast_taskprocessor *serializer, int (*sip_task)(void *), void *task_data)
{
if (serializer) {