[asterisk-commits] russell: branch 1.2 r75059 - /branches/1.2/res/res_musiconhold.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jul 13 15:07:22 CDT 2007
Author: russell
Date: Fri Jul 13 15:07:21 2007
New Revision: 75059
URL: http://svn.digium.com/view/asterisk?view=rev&rev=75059
Log:
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.
Modified:
branches/1.2/res/res_musiconhold.c
Modified: branches/1.2/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_musiconhold.c?view=diff&rev=75059&r1=75058&r2=75059
==============================================================================
--- branches/1.2/res/res_musiconhold.c (original)
+++ branches/1.2/res/res_musiconhold.c Fri Jul 13 15:07:21 2007
@@ -660,8 +660,10 @@
flags = fcntl(moh->pipe[1], F_GETFL);
fcntl(moh->pipe[1], F_SETFL, flags | O_NONBLOCK);
moh->parent = cl;
+ ast_mutex_lock(&moh_lock);
moh->next = cl->members;
cl->members = moh;
+ ast_mutex_unlock(&moh_lock);
return moh;
}
More information about the asterisk-commits
mailing list