[Asterisk-code-review] Sorcery: Create human friendly serializer names. (asterisk[master])

Joshua Colp asteriskteam at digium.com
Tue Jan 12 13:25:49 CST 2016


Joshua Colp has submitted this change and it was merged.

Change subject: Sorcery: Create human friendly serializer names.
......................................................................


Sorcery: Create human friendly serializer names.

Sorcery name formats:
sorcery/<type>-<seq> -- Sorcery thread pool serializer

Change-Id: Idc2e5d3dbab15c825b97c38c028319a0d2315c47
---
M main/sorcery.c
1 file changed, 4 insertions(+), 6 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/main/sorcery.c b/main/sorcery.c
index 0f8ec5c..a445a6e 100644
--- a/main/sorcery.c
+++ b/main/sorcery.c
@@ -823,7 +823,7 @@
 {
 #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;
@@ -856,12 +856,10 @@
 		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;
 	}

-- 
To view, visit https://gerrit.asterisk.org/1957
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idc2e5d3dbab15c825b97c38c028319a0d2315c47
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list