]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
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 29dc13a5add30f09350d6c85ec2812dd37705a74..d487428e56b471078590e45c6f211c3be0653d5a 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);