[asterisk-commits] irroot: branch irroot/distrotech-customers-10 r333940 - /team/irroot/distrote...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 30 10:12:45 CDT 2011


Author: irroot
Date: Tue Aug 30 10:12:42 2011
New Revision: 333940

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=333940
Log:
Deadlock fixes for ASTERISK-18101

Modified:
    team/irroot/distrotech-customers-10/apps/app_queue.c

Modified: team/irroot/distrotech-customers-10/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/apps/app_queue.c?view=diff&rev=333940&r1=333939&r2=333940
==============================================================================
--- team/irroot/distrotech-customers-10/apps/app_queue.c (original)
+++ team/irroot/distrotech-customers-10/apps/app_queue.c Tue Aug 30 10:12:42 2011
@@ -4109,6 +4109,7 @@
 	struct ao2_iterator queue_iter;	
 	
 	if (shared_lastcall) {
+		ao2_lock(queues);
 		queue_iter = ao2_iterator_init(queues, 0);
 		while ((qtmp = ao2_t_iterator_next(&queue_iter, "Iterate through queues"))) {
 			ao2_lock(qtmp);
@@ -4122,6 +4123,7 @@
 			queue_t_unref(qtmp, "Done with iterator");
 		}
 		ao2_iterator_destroy(&queue_iter);
+		ao2_unlock(queues);
 	} else {
 		ao2_lock(q);
 		time(&member->lastcall);
@@ -4672,9 +4674,10 @@
 	orig = to;
 	++qe->pending;
 	ao2_unlock(qe->parent);
+	if (need_weight) {
+		ao2_unlock(queues);
+	}
 	ring_one(qe, outgoing, &numbusies);
-	if (need_weight)
-		ao2_unlock(queues);
 	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed, update_connectedline);
 	/* The ast_channel_datastore_remove() function could fail here if the
 	 * datastore was moved to another channel during a masquerade. If this is




More information about the asterisk-commits mailing list