diff options
author | Matthew Nicholson <mnicholson@digium.com> | 2011-08-12 19:06:10 +0000 |
---|---|---|
committer | Matthew Nicholson <mnicholson@digium.com> | 2011-08-12 19:06:10 +0000 |
commit | c9f65ece49ead5c21a85eaeb0328d47db3edebf0 (patch) | |
tree | 17657e7f162c76155da3760c069f87247124337a /apps/app_queue.c | |
parent | 28e2aa76b2da4f10fcca286cb04fe5c251cb1204 (diff) |
Merged revisions 331775 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10
................
r331775 | mnicholson | 2011-08-12 14:03:31 -0500 (Fri, 12 Aug 2011) | 17 lines
Merged revisions 331774 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r331774 | mnicholson | 2011-08-12 14:01:27 -0500 (Fri, 12 Aug 2011) | 11 lines
Unlock the channel before calling update_queue.
Holding the channel lock when calling update_queue which attempts to lock the
queue lock can cause a deadlock. This deadlock involves the following chain:
1. hold chan lock -> wait queue lock
2. hold queue lock -> wait agent list lock
3. hold agent list lock -> wait chan list lock
4. hold chan list lock -> wait chan lock
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index 23a47b6be..683b5faa5 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -5156,8 +5156,11 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce if ((tds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL))) { ast_channel_datastore_remove(qe->chan, tds); } + ast_channel_unlock(qe->chan); update_queue(qe->parent, member, callcompletedinsl, (time(NULL) - callstart)); } else { + ast_channel_unlock(qe->chan); + /* We already logged the TRANSFER on the queue_log, but we still need to send the AgentComplete event */ send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), TRANSFER); } @@ -5165,7 +5168,6 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce if (transfer_ds) { ast_datastore_free(transfer_ds); } - ast_channel_unlock(qe->chan); ast_hangup(peer); res = bridge ? bridge : 1; ao2_ref(member, -1); |