diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-13 20:10:40 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-13 20:10:40 +0000 |
commit | ceb28ea5227e2decf185567a8395715797d4ec20 (patch) | |
tree | db0aeb7904fae09888902a188430315a0bbd85a7 /res/res_musiconhold.c | |
parent | c1980c3b306134ea450394570f738e7729f5e152 (diff) |
Merged revisions 75059 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r75059 | russell | 2007-07-13 15:07:21 -0500 (Fri, 13 Jul 2007) | 6 lines
Ensure that adding a user to the list of users of a specific music on hold
class is not done at the same time as any of the other operations on this list
to prevent list corruption. Using the global moh_data lock for this is not
ideal, but it is what is used to protect these lists everywhere else in the
module, and I am only changing what is necessary to fix the bug.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75067 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r-- | res/res_musiconhold.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 502fe9aa2..922701678 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -665,7 +665,10 @@ static struct mohdata *mohalloc(struct mohclass *cl) moh->f.offset = AST_FRIENDLY_OFFSET; moh->parent = cl; + + AST_LIST_LOCK(&mohclasses); AST_LIST_INSERT_HEAD(&cl->members, moh, list); + AST_LIST_UNLOCK(&mohclasses); return moh; } |