mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Make res deterministic, don't release lock until totally done
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -488,8 +488,6 @@ static int agent_hangup(struct ast_channel *ast)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
/* Release ownership of the agent to other threads (presumably running the login app). */
|
|
||||||
ast_mutex_unlock(&p->app_lock);
|
|
||||||
|
|
||||||
if (p->pending) {
|
if (p->pending) {
|
||||||
ast_mutex_lock(&agentlock);
|
ast_mutex_lock(&agentlock);
|
||||||
@@ -508,6 +506,8 @@ static int agent_hangup(struct ast_channel *ast)
|
|||||||
/* Store last disconnect time */
|
/* Store last disconnect time */
|
||||||
gettimeofday(&p->lastdisc, NULL);
|
gettimeofday(&p->lastdisc, NULL);
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
|
/* Release ownership of the agent to other threads (presumably running the login app). */
|
||||||
|
ast_mutex_unlock(&p->app_lock);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -539,7 +539,7 @@ static int agent_cont_sleep( void *data )
|
|||||||
static int agent_ack_sleep( void *data )
|
static int agent_ack_sleep( void *data )
|
||||||
{
|
{
|
||||||
struct agent_pvt *p;
|
struct agent_pvt *p;
|
||||||
int res;
|
int res=0;
|
||||||
int to = 1000;
|
int to = 1000;
|
||||||
|
|
||||||
/* Wait a second and look for something */
|
/* Wait a second and look for something */
|
||||||
|
Reference in New Issue
Block a user