[Asterisk-code-review] Work around thread safety issues in the PBX core. (asterisk[11])
Richard Mudgett
asteriskteam at digium.com
Fri May 22 19:34:09 CDT 2015
Richard Mudgett has posted comments on this change.
Change subject: Work around thread safety issues in the PBX core.
......................................................................
Patch Set 1: Code-Review-1
(4 comments)
https://gerrit.asterisk.org/#/c/481/1/main/features.c
File main/features.c:
Line 5582: if (res) {
Some compilers could warn about res being uninitialized here event though it technically cannot be.
https://gerrit.asterisk.org/#/c/481/1/main/pbx.c
File main/pbx.c:
Line 3125: struct ast_context *tmp = NULL;
This initialization is unnecessary.
Line 8779: if (!extcontexts) {
: if (!contexts_table) {
: contexts_table = ast_hashtab_create(17,
: ast_hashtab_compare_contexts,
: ast_hashtab_resize_java,
: ast_hashtab_newsize_java,
: ast_hashtab_hash_contexts,
: 0);
: }
This is a subtle change in behavior. Calling ast_context_find_or_create() used to always create the contexts_table if it didn't exist. Now it will only create it if extcontexts is NULL.
Since contexts_table is a global variable it might remain NULL longer than expected now.
Line 8798: tmp->refcount++;
Hmm looks like ast_context has a ref counting mechanism. Though I don't think it is actually functional.
--
To view, visit https://gerrit.asterisk.org/481
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1866b6787730c9c4f3f836b6133ffe9c820734fa
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list