[Freeswitch-svn] [commit] r8757 - freeswitch/trunk/src/mod/endpoints/mod_portaudio

Freeswitch SVN anthm at freeswitch.org
Wed Jun 4 19:15:58 EDT 2008


Author: anthm
Date: Wed Jun  4 19:15:57 2008
New Revision: 8757

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c

Log:
avoiding deadlock (by not locking then locking again)

Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	Wed Jun  4 19:15:57 2008
@@ -1561,8 +1561,6 @@
 		"pa ringdev #<num>|<partial name>\n" "--------------------------------------------------------------------------------\n";
 
 
-	switch_mutex_lock(globals.pa_mutex);
-
 	if (stream->param_event) {
 		http = switch_event_get_header(stream->param_event, "http-host");
 	}
@@ -1679,7 +1677,11 @@
 		if (http) {
 			stream->write_function(stream, "<pre>");
 		}
+
+		switch_mutex_lock(globals.pa_mutex);
 		status = func(&argv[lead], argc - lead, stream);
+		switch_mutex_unlock(globals.pa_mutex);
+
 		if (http) {
 			stream->write_function(stream, "\n\n</pre>");
 		}
@@ -1726,8 +1728,6 @@
 							   "<td><input name=action type=submit value=\"D\"></td></tr>\n" "</table>" "</form><br></center></td></tr></table>\n");
 	}
 
-	switch_mutex_lock(globals.pa_mutex);
-	
 	switch_safe_free(mycmd);
 	return status;
 }



More information about the Freeswitch-svn mailing list