[asterisk-commits] mnicholson: branch 10 r331775 - in /branches/10: ./ apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 12 14:03:35 CDT 2011


Author: mnicholson
Date: Fri Aug 12 14:03:31 2011
New Revision: 331775

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=331775
Log:
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
........

Modified:
    branches/10/   (props changed)
    branches/10/apps/app_queue.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/apps/app_queue.c?view=diff&rev=331775&r1=331774&r2=331775
==============================================================================
--- branches/10/apps/app_queue.c (original)
+++ branches/10/apps/app_queue.c Fri Aug 12 14:03:31 2011
@@ -5138,8 +5138,11 @@
 			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);
 		}
@@ -5147,7 +5150,6 @@
 		if (transfer_ds) {
 			ast_datastore_free(transfer_ds);
 		}
-		ast_channel_unlock(qe->chan);
 		ast_hangup(peer);
 		res = bridge ? bridge : 1;
 		ao2_ref(member, -1);




More information about the asterisk-commits mailing list