avoiding deadlock (by not locking then locking again)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8757 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-06-04 23:15:57 +00:00
parent f7c8ef4a3b
commit f78f0592f5

View File

@ -1561,8 +1561,6 @@ SWITCH_STANDARD_API(pa_cmd)
"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 @@ SWITCH_STANDARD_API(pa_cmd)
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 @@ SWITCH_STANDARD_API(pa_cmd)
"<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;
}