]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
bridge_roles: Use a non-locking linked list where appropriate
authorSean Bright <sean.bright@gmail.com>
Thu, 15 Feb 2018 20:30:35 +0000 (15:30 -0500)
committerSean Bright <sean.bright@gmail.com>
Thu, 15 Feb 2018 20:30:35 +0000 (15:30 -0500)
Also explicitly initialize with the AST_LIST_HEAD_NOLOCK_INIT macro for
clarity.

Change-Id: I4bc39ec33bc3ff77e1a971a01ace87deb965be3f

main/bridge_roles.c

index 1d781ca93caab91f98312cafc06d99b9f52ac404..d68e6b169f472681f026cbbb0d349d5f048f597d 100644 (file)
@@ -53,12 +53,12 @@ struct bridge_role_option {
 
 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;
 };
 
 /*!
@@ -130,6 +130,8 @@ static struct bridge_roles_datastore *setup_bridge_roles_datastore(struct ast_ch
                return NULL;
        }
 
+       AST_LIST_HEAD_INIT_NOLOCK(&roles_datastore->role_list);
+
        datastore->data = roles_datastore;
        ast_channel_datastore_add(chan, datastore);
        return roles_datastore;
@@ -266,6 +268,8 @@ static int setup_bridge_role(struct bridge_roles_datastore *roles_datastore, con
                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);