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/branches/1.2@75059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-07-13 20:07:21 +00:00
parent 460df0480b
commit ab2a84f410

View File

@@ -660,8 +660,10 @@ static struct mohdata *mohalloc(struct mohclass *cl)
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;
}