From: Russell Bryant Date: Fri, 13 Jul 2007 20:14:23 +0000 (+0000) Subject: Merged revisions 75067 via svnmerge from X-Git-Tag: 1.6.0-beta1~3^2~2065 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcd3f8dbea81ca4e5cce2a4501cf15bfe952cfba;p=thirdparty%2Fasterisk.git Merged revisions 75067 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r75067 | russell | 2007-07-13 15:10:40 -0500 (Fri, 13 Jul 2007) | 14 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@75075 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 13509fcbd9..84a44f3b75 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -695,7 +695,10 @@ static struct mohdata *mohalloc(struct mohclass *cl) moh->f.offset = AST_FRIENDLY_OFFSET; moh->parent = cl; + + AST_RWLIST_WRLOCK(&mohclasses); AST_LIST_INSERT_HEAD(&cl->members, moh, list); + AST_RWLIST_UNLOCK(&mohclasses); return moh; }