From: Richard Mudgett Date: Thu, 7 Jan 2016 01:09:43 +0000 (-0600) Subject: Sorcery: Create human friendly serializer names. X-Git-Tag: 13.8.0-rc1~139^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4276f185f0718b2d0de2d021c3629cc719c78745;p=thirdparty%2Fasterisk.git Sorcery: Create human friendly serializer names. Sorcery name formats: sorcery/- -- Sorcery thread pool serializer Change-Id: Idc2e5d3dbab15c825b97c38c028319a0d2315c47 --- diff --git a/main/sorcery.c b/main/sorcery.c index e78fc5c6a4..774d001a6e 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; }