mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
handle app_lock properly
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -557,14 +557,13 @@ static int agent_ack_sleep( void *data )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
if (p->app_sleep_cond) {
|
if (!p->app_sleep_cond) {
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
res = 0;
|
res = 0;
|
||||||
break;
|
break;
|
||||||
} else if (res == '#') {
|
} else if (res == '#') {
|
||||||
check_availability(p, 0);
|
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
res = 0;
|
res = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
@@ -1224,6 +1223,11 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
|
|||||||
res = ast_safe_sleep_conditional( chan, 1000,
|
res = ast_safe_sleep_conditional( chan, 1000,
|
||||||
agent_cont_sleep, p );
|
agent_cont_sleep, p );
|
||||||
ast_mutex_unlock( &p->app_lock );
|
ast_mutex_unlock( &p->app_lock );
|
||||||
|
if ((p->ackcall > 1) && (res == 1)) {
|
||||||
|
ast_mutex_lock(&p->lock);
|
||||||
|
check_availability(p, 0);
|
||||||
|
ast_mutex_unlock(&p->lock);
|
||||||
|
}
|
||||||
sched_yield();
|
sched_yield();
|
||||||
}
|
}
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
|
Reference in New Issue
Block a user