summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-01-06 19:09:43 -0600
committerRichard Mudgett <rmudgett@digium.com>2016-01-08 22:03:28 -0600
commit4276f185f0718b2d0de2d021c3629cc719c78745 (patch)
treefcbc29b10fd535b20e704c396eea04ea790d74fb
parentf02ac1b7f954a3445da9007b3d9bf4f0706e750a (diff)
Sorcery: Create human friendly serializer names.
Sorcery name formats: sorcery/<type>-<seq> -- Sorcery thread pool serializer Change-Id: Idc2e5d3dbab15c825b97c38c028319a0d2315c47
-rw-r--r--main/sorcery.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/main/sorcery.c b/main/sorcery.c
index e78fc5c6a..774d001a6 100644
--- a/main/sorcery.c
+++ b/main/sorcery.c
@@ -820,7 +820,7 @@ static struct ast_sorcery_object_type *sorcery_object_type_alloc(const char *typ
{
#define INITIAL_WIZARD_VECTOR_SIZE 5
struct ast_sorcery_object_type *object_type;
- char uuid[AST_UUID_STR_LEN];
+ char tps_name[AST_TASKPROCESSOR_MAX_NAME + 1];
if (!(object_type = ao2_alloc(sizeof(*object_type), sorcery_object_type_destructor))) {
return NULL;
@@ -853,12 +853,10 @@ static struct ast_sorcery_object_type *sorcery_object_type_alloc(const char *typ
return NULL;
}
- if (!ast_uuid_generate_str(uuid, sizeof(uuid))) {
- ao2_ref(object_type, -1);
- return NULL;
- }
+ /* Create name with seq number appended. */
+ ast_taskprocessor_build_name(tps_name, sizeof(tps_name), "sorcery/%s", type);
- if (!(object_type->serializer = ast_threadpool_serializer(uuid, threadpool))) {
+ if (!(object_type->serializer = ast_threadpool_serializer(tps_name, threadpool))) {
ao2_ref(object_type, -1);
return NULL;
}