[asterisk-commits] rmudgett: branch 1.4 r305341 - /branches/1.4/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 31 17:46:02 CST 2011


Author: rmudgett
Date: Mon Jan 31 17:45:58 2011
New Revision: 305341

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=305341
Log:
Obtain the pri lock for PRI queue counters.

Need to obtain the pri lock when calling pri_dump_info_str() to avoid a
reentrancy problem when calculating the Q.921 Q count statistic.

JIRA AST-484

Modified:
    branches/1.4/channels/chan_dahdi.c

Modified: branches/1.4/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/channels/chan_dahdi.c?view=diff&rev=305341&r1=305340&r2=305341
==============================================================================
--- branches/1.4/channels/chan_dahdi.c (original)
+++ branches/1.4/channels/chan_dahdi.c Mon Jan 31 17:45:58 2011
@@ -10871,6 +10871,7 @@
 			ast_cli(fd, "%s D-channel: %d\n", pri_order(x), pris[span-1].dchannels[x]);
 			build_status(status, sizeof(status), pris[span-1].dchanavail[x], pris[span-1].dchans[x] == pris[span-1].pri);
 			ast_cli(fd, "Status: %s\n", status);
+			ast_mutex_lock(&pris[span - 1].lock);
 #ifdef PRI_DUMP_INFO_STR
 			info_str = pri_dump_info_str(pris[span-1].pri);
 			if (info_str) {
@@ -10880,6 +10881,7 @@
 #else
 			pri_dump_info(pris[span-1].pri);
 #endif
+			ast_mutex_unlock(&pris[span - 1].lock);
 			ast_cli(fd, "Overlap Recv: %s\n\n", (pris[span-1].overlapdial & DAHDI_OVERLAPDIAL_INCOMING)?"Yes":"No");
 		}
 	}




More information about the asterisk-commits mailing list