diff options
author | Richard Mudgett <rmudgett@digium.com> | 2016-01-06 19:10:16 -0600 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2016-01-08 22:11:45 -0600 |
commit | 0bca2a5c26bae18dadc368e22dbbeae6b61c5cd7 (patch) | |
tree | b46d6d10a987e964393bdfa18048e74eb5722af9 /res/res_pjsip.c | |
parent | f0f5fbbc01ad2ba325f09dc80a92c3c22374ab67 (diff) |
res_pjsip: Create human friendly serializer names.
PJSIP name formats:
pjsip/aor/<aor>-<seq> -- registrar thread pool serializer
pjsip/default-<seq> -- default thread pool serializer
pjsip/messaging -- messaging thread pool serializer
pjsip/outreg/<registration>-<seq> -- outbound registration thread pool
serializer
pjsip/pubsub/<endpoint>-<seq> -- pubsub thread pool serializer
pjsip/refer/<endpoint>-<seq> -- REFER thread pool serializer
pjsip/session/<endpoint>-<seq> -- session thread pool serializer
pjsip/websocket-<seq> -- websocket thread pool serializer
Change-Id: Iff9df8da3ddae1132cb2ef65f64df0c465c5e084
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r-- | res/res_pjsip.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index a4748d20e..bf26fca8c 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -3433,23 +3433,14 @@ int ast_sip_append_body(pjsip_tx_data *tdata, const char *body_text) return 0; } -struct ast_taskprocessor *ast_sip_create_serializer_group(struct ast_serializer_shutdown_group *shutdown_group) +struct ast_taskprocessor *ast_sip_create_serializer_group(const char *name, 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_group(name, sip_threadpool, shutdown_group); - if (!serializer) { - return NULL; - } - return serializer; + return ast_threadpool_serializer_group(name, sip_threadpool, shutdown_group); } -struct ast_taskprocessor *ast_sip_create_serializer(void) +struct ast_taskprocessor *ast_sip_create_serializer(const char *name) { - return ast_sip_create_serializer_group(NULL); + return ast_sip_create_serializer_group(name, NULL); } /*! @@ -3479,10 +3470,14 @@ static void serializer_pool_shutdown(void) */ static int serializer_pool_setup(void) { + char tps_name[AST_TASKPROCESSOR_MAX_NAME + 1]; int idx; for (idx = 0; idx < SERIALIZER_POOL_SIZE; ++idx) { - serializer_pool[idx] = ast_sip_create_serializer(); + /* Create name with seq number appended. */ + ast_taskprocessor_build_name(tps_name, sizeof(tps_name), "pjsip/default"); + + serializer_pool[idx] = ast_sip_create_serializer(tps_name); if (!serializer_pool[idx]) { serializer_pool_shutdown(); return -1; |