mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 10:51:40 +00:00
Fix potential race in check_availability
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -605,7 +605,7 @@ static int check_availability(struct agent_pvt *newlyavailable, int needlock)
|
||||
continue;
|
||||
}
|
||||
ast_pthread_mutex_lock(&p->lock);
|
||||
if (p->pending && ((p->group && (newlyavailable->group & p->group)) || !strcmp(p->agent, newlyavailable->agent))) {
|
||||
if (!p->abouttograb && p->pending && ((p->group && (newlyavailable->group & p->group)) || !strcmp(p->agent, newlyavailable->agent))) {
|
||||
ast_log(LOG_DEBUG, "Call '%s' looks like a winner for agent '%s'\n", p->owner->name, newlyavailable->agent);
|
||||
/* We found a pending call, time to merge */
|
||||
chan = agent_new(newlyavailable, AST_STATE_DOWN);
|
||||
|
Reference in New Issue
Block a user