[Asterisk-code-review] bridge roles: Use a non-locking linked list where appropriate (asterisk[master])

Sean Bright asteriskteam at digium.com
Thu Feb 15 14:31:32 CST 2018


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/8218


Change subject: bridge_roles: Use a non-locking linked list where appropriate
......................................................................

bridge_roles: Use a non-locking linked list where appropriate

Also explicitly initialize with the AST_LIST_HEAD_NOLOCK_INIT macro for
clarity.

Change-Id: I4bc39ec33bc3ff77e1a971a01ace87deb965be3f
---
M main/bridge_roles.c
1 file changed, 6 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/18/8218/1

diff --git a/main/bridge_roles.c b/main/bridge_roles.c
index a9b95a3..6dbae6f 100644
--- a/main/bridge_roles.c
+++ b/main/bridge_roles.c
@@ -51,12 +51,12 @@
 
 struct bridge_role {
 	AST_LIST_ENTRY(bridge_role) list;
-	AST_LIST_HEAD(, bridge_role_option) options;
+	AST_LIST_HEAD_NOLOCK(, bridge_role_option) options;
 	char role[AST_ROLE_LEN];
 };
 
 struct bridge_roles_datastore {
-	AST_LIST_HEAD(, bridge_role) role_list;
+	AST_LIST_HEAD_NOLOCK(, bridge_role) role_list;
 };
 
 /*!
@@ -127,6 +127,8 @@
 		ast_datastore_free(datastore);
 		return NULL;
 	}
+
+	AST_LIST_HEAD_INIT_NOLOCK(&roles_datastore->role_list);
 
 	datastore->data = roles_datastore;
 	ast_channel_datastore_add(chan, datastore);
@@ -264,6 +266,8 @@
 		return -1;
 	}
 
+	AST_LIST_HEAD_INIT_NOLOCK(&role->options);
+
 	ast_copy_string(role->role, role_name, sizeof(role->role));
 
 	AST_LIST_INSERT_TAIL(&roles_datastore->role_list, role, list);

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4bc39ec33bc3ff77e1a971a01ace87deb965be3f
Gerrit-Change-Number: 8218
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180215/7912dd92/attachment.html>


More information about the asterisk-code-review mailing list