[Asterisk-code-review] Work around thread safety issues in the PBX core. (asterisk[11])

Corey Farrell asteriskteam at digium.com
Mon Jun 1 03:28:47 CDT 2015


Corey Farrell has posted comments on this change.

Change subject: Work around thread safety issues in the PBX core.
......................................................................


Patch Set 1:

> I'll add that the ast_rd/wrlock_context()/ast_unlock_context()
 > functions already are public and used outside of pbx core by some
 > modules.  This patch just adds more instances of the same pattern.
 > 
 > Also the rd/wr lock has been a sham for a long time since they are
 > actually using a mutex because the locks get reentrantly held.

This greatly reduces the patch, I hadn't realized it wasn't rd/wr lock.  All nolock variations will go away since locking can be added around them, I think ast_context_destroy_by_name is still useful.

In master I think we should just remove locking from these functions, except when ast_context_find_or_create creates the global context when working with extcontexts != NULL.

Also in master could we just have ast_context_lock and ast_contexts_lock?  The current rd/wr names are confusing, lead to believing it's unsafe to lock anything.  Probably a separate commit for that.

-- 
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: No



More information about the asterisk-code-review mailing list