mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user