[asterisk-commits] file: branch 1.6.2 r184629 - in /branches/1.6.2: ./ bridges/bridge_softmix.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 27 09:00:00 CDT 2009


Author: file
Date: Fri Mar 27 08:59:57 2009
New Revision: 184629

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=184629
Log:
Merged revisions 184628 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r184628 | file | 2009-03-27 10:57:29 -0300 (Fri, 27 Mar 2009) | 6 lines
  
  Fix a potential race condition when creating a software based mixing bridge.
  
  It was possible for no timer to become available between creating the bridge
  and starting it. We now open a timer when creating it and keep it open until the
  bridge is destroyed.
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/bridges/bridge_softmix.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/bridges/bridge_softmix.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.2/bridges/bridge_softmix.c?view=diff&rev=184629&r1=184628&r2=184629
==============================================================================
--- branches/1.6.2/bridges/bridge_softmix.c (original)
+++ branches/1.6.2/bridges/bridge_softmix.c Fri Mar 27 08:59:57 2009
@@ -91,7 +91,7 @@
 		return -1;
 	}
 
-	ast_timer_close(timingfd);
+	bridge->bridge_pvt = (void*)(unsigned long)timingfd;
 
 	return 0;
 }
@@ -199,11 +199,7 @@
 /*! \brief Function which acts as the mixing thread */
 static int softmix_bridge_thread(struct ast_bridge *bridge)
 {
-	int timingfd;
-
-	if ((timingfd = ast_timer_open()) < 0) {
-		return -1;
-	}
+	int timingfd = (unsigned short)(unsigned long)bridge->bridge_pvt;
 
 	ast_timer_set_rate(timingfd, (1000 / SOFTMIX_INTERVAL));
 
@@ -267,7 +263,6 @@
 		ao2_lock(bridge);
 	}
 
-	ast_timer_set_rate(timingfd, 0);
 	ast_timer_close(timingfd);
 
 	return 0;




More information about the asterisk-commits mailing list