Lock agents while removing pending ones
authorMark Spencer <markster@digium.com>
Tue, 8 Jul 2003 19:02:36 +0000 (19:02 +0000)
committerMark Spencer <markster@digium.com>
Tue, 8 Jul 2003 19:02:36 +0000 (19:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1168 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c

index 29dc13a..d487428 100755 (executable)
@@ -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);