[asterisk-commits] rmudgett: trunk r301947 - in /trunk: ./ channels/sig_pri.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 14 15:13:13 CST 2011


Author: rmudgett
Date: Fri Jan 14 15:13:08 2011
New Revision: 301947

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=301947
Log:
Merged revisions 301946 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r301946 | rmudgett | 2011-01-14 15:09:57 -0600 (Fri, 14 Jan 2011) | 13 lines
  
  Deadlock between dahdi_request() and pri_dchannel() processing an incomming call.
  
  The sig_pri_new_ast_channel() is called with the channel private lock held
  when pri_dchannel() calls it and no channel private lock held when
  dahdi_request() calls it.  The use of pri_grab() in
  sig_pri_new_ast_channel() could leave the channel private lock held when
  it returns if the lock was not held before calling it.
  
  Make sig_pri_new_ast_channel() just lock the PRI span lock instead of
  using pri_grab().  It is safe to do this because dahdi_request() does not
  have the channel private lock and the deadlock potential with the PRI span
  lock is only between pri_dchannel() and other threads.
........

Modified:
    trunk/   (props changed)
    trunk/channels/sig_pri.c

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

Modified: trunk/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_pri.c?view=diff&rev=301947&r1=301946&r2=301947
==============================================================================
--- trunk/channels/sig_pri.c (original)
+++ trunk/channels/sig_pri.c Fri Jan 14 15:13:08 2011
@@ -880,11 +880,10 @@
 	if (transfercapability & AST_TRANS_CAP_DIGITAL) {
 		sig_pri_set_digital(p, 1);
 	}
-	if (p->pri && !pri_grab(p, p->pri)) {
+	if (p->pri) {
+		ast_mutex_lock(&p->pri->lock);
 		sig_pri_span_devstate_changed(p->pri);
-		pri_rel(p->pri);
-	} else {
-		ast_log(LOG_WARNING, "Failed to grab PRI!\n");
+		ast_mutex_unlock(&p->pri->lock);
 	}
 
 	return c;




More information about the asterisk-commits mailing list