mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 07:48:14 +00:00
Lock agents while removing pending ones
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -348,7 +348,9 @@ static int agent_hangup(struct ast_channel *ast)
|
|||||||
ast_pthread_mutex_unlock(&p->app_lock);
|
ast_pthread_mutex_unlock(&p->app_lock);
|
||||||
|
|
||||||
if (p->pending) {
|
if (p->pending) {
|
||||||
|
ast_pthread_mutex_lock(&agentlock);
|
||||||
agent_unlink(p);
|
agent_unlink(p);
|
||||||
|
ast_pthread_mutex_unlock(&agentlock);
|
||||||
}
|
}
|
||||||
if (p->dead)
|
if (p->dead)
|
||||||
free(p);
|
free(p);
|
||||||
|
|||||||
Reference in New Issue
Block a user