[asterisk-commits] murf: branch murf/mtxprof r126640 - in /team/murf/mtxprof: channels/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 30 16:14:14 CDT 2008


Author: murf
Date: Mon Jun 30 16:14:13 2008
New Revision: 126640

URL: http://svn.digium.com/view/asterisk?view=rev&rev=126640
Log:
removal of a channel lock in sip, in the handle_request_invite call, before the pbx_start, seems to improve the situation greatly, but...

Modified:
    team/murf/mtxprof/channels/chan_sip.c
    team/murf/mtxprof/main/channel.c
    team/murf/mtxprof/main/pbx.c

Modified: team/murf/mtxprof/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/mtxprof/channels/chan_sip.c?view=diff&rev=126640&r1=126639&r2=126640
==============================================================================
--- team/murf/mtxprof/channels/chan_sip.c (original)
+++ team/murf/mtxprof/channels/chan_sip.c Mon Jun 30 16:14:13 2008
@@ -17828,11 +17828,12 @@
 
 			/* Save Record-Route for any later requests we make on this dialogue */
 			build_route(p, req, 0);
-
+#ifdef WHAT_IF_WE_DONT_LOCK_THE_CHANNEL
 			if (c) {
 				/* Pre-lock the call */
 				ast_channel_lock(c);
 			}
+#endif
 		}
 	} else {
 		if (sipdebug) {
@@ -19637,10 +19638,11 @@
 		
 	if (recount)
 		ast_update_use_count();
-
+#ifdef EXPERIMENT_TO_NOT_UNLOCK_IF_NOT_LOCKED
 	if (p->owner && !nounlock) {
 		ast_channel_unlock(p->owner);
 	}
+#endif
 	sip_pvt_unlock(p);
 	ast_mutex_unlock(&netlock);
 	ao2_t_ref(p, -1, "throw away dialog ptr from find_call at end of routine"); /* p is gone after the return */

Modified: team/murf/mtxprof/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/murf/mtxprof/main/channel.c?view=diff&rev=126640&r1=126639&r2=126640
==============================================================================
--- team/murf/mtxprof/main/channel.c (original)
+++ team/murf/mtxprof/main/channel.c Mon Jun 30 16:14:13 2008
@@ -1165,7 +1165,7 @@
 		done = c == NULL || lockret == 0;
 		if (!done) {
 			ast_debug(1, "Avoiding %s for channel '%p'\n", msg, c);
-			if (retries == 199) {
+			if (retries == 19) {
 				/* We are about to fail due to a deadlock, so report this
 				 * while we still have the list lock.
 				 */

Modified: team/murf/mtxprof/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/murf/mtxprof/main/pbx.c?view=diff&rev=126640&r1=126639&r2=126640
==============================================================================
--- team/murf/mtxprof/main/pbx.c (original)
+++ team/murf/mtxprof/main/pbx.c Mon Jun 30 16:14:13 2008
@@ -3798,7 +3798,6 @@
 	   PBX has finished running on the channel
 	 */
 	struct ast_channel *c = data;
-	usleep(1);
 	
 	__ast_pbx_run(c);
 	decrease_call_count();
@@ -3811,6 +3810,14 @@
 enum ast_pbx_result ast_pbx_start(struct ast_channel *c)
 {
 	pthread_t t;
+	struct timeval start9 = ast_tvnow(), end9;
+	static int totaltime = 0;
+	static int numtimes = 0;
+	int timediff;
+	struct timeval start92, end92;
+	static int totaltime2 = 0;
+	static int numtimes2 = 0;
+	int timediff2;
 
 	if (!c) {
 		ast_log(LOG_WARNING, "Asked to start thread on NULL channel?\n");
@@ -3820,6 +3827,17 @@
 	if (increase_call_count(c))
 		return AST_PBX_CALL_LIMIT;
 
+	end9 = ast_tvnow();
+	timediff = ast_tvdiff_us(end9, start9);
+	totaltime += timediff;
+	numtimes++;
+	start92 = ast_tvnow();
+	ast_log(LOG_NOTICE,"increase_call_count took %d microseconds, avg=%d usec (%d times)\n", timediff, totaltime/numtimes, numtimes);
+	end92 = ast_tvnow();
+	timediff2 = ast_tvdiff_us(end92, start92);
+	totaltime2 += timediff2;
+	numtimes2++;
+	ast_log(LOG_NOTICE,"ast_log took %d microseconds, avg=%d usec (%d times)\n", timediff2, totaltime2/numtimes2, numtimes2);
 	/* Start a new thread, and get something handling this channel. */
 	if (ast_pthread_create_detached(&t, NULL, pbx_thread, c)) {
 		ast_log(LOG_WARNING, "Failed to create new channel thread\n");




More information about the asterisk-commits mailing list