mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
Be sure we have the agent lock
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1213,6 +1213,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
|
||||
if (res)
|
||||
break;
|
||||
|
||||
ast_mutex_lock(&agentlock);
|
||||
ast_mutex_lock(&p->lock);
|
||||
if (p->lastdisc.tv_sec) {
|
||||
gettimeofday(&tv, NULL);
|
||||
@@ -1227,6 +1228,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
|
||||
}
|
||||
}
|
||||
ast_mutex_unlock(&p->lock);
|
||||
ast_mutex_unlock(&agentlock);
|
||||
/* Synchronize channel ownership between call to agent and itself. */
|
||||
ast_mutex_lock( &p->app_lock );
|
||||
ast_mutex_lock(&p->lock);
|
||||
@@ -1239,9 +1241,11 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
|
||||
agent_cont_sleep, p );
|
||||
ast_mutex_unlock( &p->app_lock );
|
||||
if ((p->ackcall > 1) && (res == 1)) {
|
||||
ast_mutex_lock(&agentlock);
|
||||
ast_mutex_lock(&p->lock);
|
||||
check_availability(p, 0);
|
||||
ast_mutex_unlock(&p->lock);
|
||||
ast_mutex_unlock(&agentlock);
|
||||
res = 0;
|
||||
}
|
||||
sched_yield();
|
||||
|
Reference in New Issue
Block a user