[svn-commits] mmichelson: trunk r81159 - in /trunk: ./ apps/app_queue.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Aug 27 17:41:01 CDT 2007


Author: mmichelson
Date: Mon Aug 27 17:41:00 2007
New Revision: 81159

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81159
Log:
Merged revisions 81158 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81158 | mmichelson | 2007-08-27 17:40:19 -0500 (Mon, 27 Aug 2007) | 5 lines

Resolve a potential deadlock. In this case, a single queue is locked, then the queue list. In changethread(), the queue list is
locked, and then each individual queue is locked. Under the right circumstances, this could deadlock. As such, I have unlocked
the individual queue before locking the queue list, and then locked the queue back after the queue list is unlocked.


........

Modified:
    trunk/   (props changed)
    trunk/apps/app_queue.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=81159&r1=81158&r2=81159
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Mon Aug 27 17:41:00 2007
@@ -1198,7 +1198,9 @@
 			} else {
 				q->members = next_m;
 			}
+			ast_mutex_unlock(&q->lock);
 			remove_from_interfaces(m->interface);
+			ast_mutex_lock(&q->lock);
 			q->membercount--;
 			ast_free(m);
 		} else {
@@ -1300,7 +1302,9 @@
 			} else {
 				q->members = next_m;
 			}
+			ast_mutex_unlock(&q->lock);
 			remove_from_interfaces(m->interface);
+			ast_mutex_lock(&q->lock);
 			q->membercount--;
 			free(m);
 		} else {




More information about the svn-commits mailing list