From f78f0592f56be87b6708775c199189b60d984cc0 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 4 Jun 2008 23:15:57 +0000 Subject: [PATCH] avoiding deadlock (by not locking then locking again) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8757 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_portaudio/mod_portaudio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mod/endpoints/mod_portaudio/mod_portaudio.c b/src/mod/endpoints/mod_portaudio/mod_portaudio.c index fad84e7834..6c67c4e6ac 100644 --- a/src/mod/endpoints/mod_portaudio/mod_portaudio.c +++ b/src/mod/endpoints/mod_portaudio/mod_portaudio.c @@ -1561,8 +1561,6 @@ SWITCH_STANDARD_API(pa_cmd) "pa ringdev #|\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 @@ SWITCH_STANDARD_API(pa_cmd) if (http) { stream->write_function(stream, "
");
 		}
+
+		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
"); } @@ -1726,8 +1728,6 @@ SWITCH_STANDARD_API(pa_cmd) "\n" "" "
\n"); } - switch_mutex_lock(globals.pa_mutex); - switch_safe_free(mycmd); return status; }