diff options
-rwxr-xr-x | channel.c | 4 | ||||
-rwxr-xr-x | include/asterisk/cdr.h | 1 | ||||
-rwxr-xr-x | include/asterisk/chanvars.h | 2 | ||||
-rwxr-xr-x | include/asterisk/linkedlists.h | 2 | ||||
-rwxr-xr-x | pbx.c | 2 | ||||
-rwxr-xr-x | pbx/pbx_dundi.c | 2 | ||||
-rwxr-xr-x | pbx/pbx_loopback.c | 2 |
7 files changed, 9 insertions, 6 deletions
@@ -585,7 +585,7 @@ struct ast_channel *ast_channel_alloc(int needqueue) snprintf(tmp->uniqueid, sizeof(tmp->uniqueid), "%li.%d", (long) time(NULL), uniqueint++); headp = &tmp->varshead; ast_mutex_init(&tmp->lock); - AST_LIST_HEAD_INIT(headp); + AST_LIST_HEAD_INIT_NOLOCK(headp); strcpy(tmp->context, "default"); ast_copy_string(tmp->language, defaultlanguage, sizeof(tmp->language)); strcpy(tmp->exten, "s"); @@ -2976,7 +2976,7 @@ int ast_do_masquerade(struct ast_channel *original) original->fds[x] = clone->fds[x]; } clone_variables(original, clone); - clone->varshead.first = NULL; + AST_LIST_HEAD_INIT_NOLOCK(&clone->varshead); /* Presense of ADSI capable CPE follows clone */ original->adsicpe = clone->adsicpe; /* Bridge remains the same */ diff --git a/include/asterisk/cdr.h b/include/asterisk/cdr.h index e14b7c653..2ca567134 100755 --- a/include/asterisk/cdr.h +++ b/include/asterisk/cdr.h @@ -47,7 +47,6 @@ #include "asterisk/channel.h" struct ast_channel; -AST_LIST_HEAD(varshead,ast_var_t); /*! Responsible for call detail data */ struct ast_cdr { diff --git a/include/asterisk/chanvars.h b/include/asterisk/chanvars.h index 32cccf334..d31c05e86 100755 --- a/include/asterisk/chanvars.h +++ b/include/asterisk/chanvars.h @@ -31,6 +31,8 @@ struct ast_var_t { char name[0]; }; +AST_LIST_HEAD_NOLOCK(varshead, ast_var_t); + struct ast_var_t *ast_var_assign(const char *name, const char *value); void ast_var_delete(struct ast_var_t *var); char *ast_var_name(struct ast_var_t *var); diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h index 3dcd9a563..fd2203cd7 100755 --- a/include/asterisk/linkedlists.h +++ b/include/asterisk/linkedlists.h @@ -369,6 +369,8 @@ struct { \ #define AST_LIST_INSERT_HEAD(head, elm, field) do { \ (elm)->field.next = (head)->first; \ (head)->first = (elm); \ + if (!(head)->last) \ + (head)->last = (elm); \ } while (0) /*! @@ -6150,7 +6150,7 @@ int load_pbx(void) ast_verbose( "Asterisk PBX Core Initializing\n"); ast_verbose( "Registering builtin applications:\n"); } - AST_LIST_HEAD_INIT(&globals); + AST_LIST_HEAD_INIT_NOLOCK(&globals); ast_cli_register_multiple(pbx_cli, sizeof(pbx_cli) / sizeof(pbx_cli[0])); /* Register builtin applications */ diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 0dce9670f..c0165d962 100755 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -559,7 +559,7 @@ static int dundi_lookup_local(struct dundi_result *dr, struct dundi_mapping *map dr[anscnt].eid = *us_eid; dundi_eid_to_str(dr[anscnt].eid_str, sizeof(dr[anscnt].eid_str), &dr[anscnt].eid); if (ast_test_flag(&flags, DUNDI_FLAG_EXISTS)) { - AST_LIST_HEAD_INIT(&headp); + AST_LIST_HEAD_INIT_NOLOCK(&headp); newvariable = ast_var_assign("NUMBER", called_number); AST_LIST_INSERT_HEAD(&headp, newvariable, entries); newvariable = ast_var_assign("EID", dr[anscnt].eid_str); diff --git a/pbx/pbx_loopback.c b/pbx/pbx_loopback.c index aeba07dcb..6fa35f2db 100755 --- a/pbx/pbx_loopback.c +++ b/pbx/pbx_loopback.c @@ -88,7 +88,7 @@ static char *loopback_helper(char *buf, int buflen, const char *exten, const cha snprintf(tmp, sizeof(tmp), "%d", priority); memset(buf, 0, buflen); - AST_LIST_HEAD_INIT(&headp); + AST_LIST_HEAD_INIT_NOLOCK(&headp); newvariable = ast_var_assign("EXTEN", exten); AST_LIST_INSERT_HEAD(&headp, newvariable, entries); newvariable = ast_var_assign("CONTEXT", context); |