[asterisk-commits] rmudgett: trunk r259229 - /trunk/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 27 11:52:33 CDT 2010


Author: rmudgett
Date: Tue Apr 27 11:52:29 2010
New Revision: 259229

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=259229
Log:
Re-fix dahdi_request() iflist locking since CCSS merged.

Modified:
    trunk/channels/chan_dahdi.c

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=259229&r1=259228&r2=259229
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Tue Apr 27 11:52:29 2010
@@ -12522,15 +12522,16 @@
 	int transcapdigital = 0;
 	struct dahdi_starting_point start;
 
+	ast_mutex_lock(&iflock);
 	p = determine_starting_point(data, &start);
 	if (!p) {
 		/* We couldn't determine a starting point, which likely means badly-formatted channel name. Abort! */
+		ast_mutex_unlock(&iflock);
 		return NULL;
 	}
 
 	/* Search for an unowned channel */
 	exitpvt = p;
-	ast_mutex_lock(&iflock);
 	while (p && !tmp) {
 		if (start.roundrobin)
 			round_robin[start.rr_starting_point] = p;
@@ -12714,11 +12715,12 @@
 	int groupmatched = 0;
 	int channelmatched = 0;
 
+	ast_mutex_lock(&iflock);
 	p = determine_starting_point(dest, &start);
 	if (!p) {
+		ast_mutex_unlock(&iflock);
 		return -1;
 	}
-	ast_mutex_lock(&iflock);
 	exitpvt = p;
 	for (;;) {
 		if (is_group_or_channel_match(p, start.span, start.groupmatch, &groupmatched, start.channelmatch, &channelmatched)) {




More information about the asterisk-commits mailing list