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:
Mark Spencer
2003-07-08 19:02:36 +00:00
parent a5a9db828e
commit f88d485e38

View File

@@ -348,7 +348,9 @@ static int agent_hangup(struct ast_channel *ast)
ast_pthread_mutex_unlock(&p->app_lock);
if (p->pending) {
ast_pthread_mutex_lock(&agentlock);
agent_unlink(p);
ast_pthread_mutex_unlock(&agentlock);
}
if (p->dead)
free(p);