提交 f99ee375 authored 作者: Michael Giagnocavo's avatar Michael Giagnocavo

Detach mono threads

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14502 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 145859d8
...@@ -375,11 +375,17 @@ SWITCH_STANDARD_API(managedrun_api_function) ...@@ -375,11 +375,17 @@ SWITCH_STANDARD_API(managedrun_api_function)
stream->write_function(stream, "-ERR no args specified!\n"); stream->write_function(stream, "-ERR no args specified!\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
#ifndef _MANAGED
mono_thread_attach(globals.domain);
#endif
if (executeBackgroundDelegate(cmd)) { if (executeBackgroundDelegate(cmd)) {
stream->write_function(stream, "+OK\n"); stream->write_function(stream, "+OK\n");
} else { } else {
stream->write_function(stream, "-ERR ExecuteBackground returned false (unknown module or exception?).\n"); stream->write_function(stream, "-ERR ExecuteBackground returned false (unknown module or exception?).\n");
} }
#ifndef _MANAGED
mono_thread_detach(mono_thread_current());
#endif
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -389,9 +395,15 @@ SWITCH_STANDARD_API(managed_api_function) ...@@ -389,9 +395,15 @@ SWITCH_STANDARD_API(managed_api_function)
stream->write_function(stream, "-ERR no args specified!\n"); stream->write_function(stream, "-ERR no args specified!\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
#ifndef _MANAGED
mono_thread_attach(globals.domain);
#endif
if (!(executeDelegate(cmd, stream, stream->param_event))) { if (!(executeDelegate(cmd, stream, stream->param_event))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Execute failed for %s (unknown module or exception).\n", cmd); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Execute failed for %s (unknown module or exception).\n", cmd);
} }
#ifndef _MANAGED
mono_thread_detach(mono_thread_current());
#endif
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -401,9 +413,15 @@ SWITCH_STANDARD_APP(managed_app_function) ...@@ -401,9 +413,15 @@ SWITCH_STANDARD_APP(managed_app_function)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No args specified!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No args specified!\n");
return; return;
} }
#ifndef _MANAGED
mono_thread_attach(globals.domain);
#endif
if (!(runDelegate(data, session))) { if (!(runDelegate(data, session))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Application run failed for %s (unknown module or exception).\n", data); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Application run failed for %s (unknown module or exception).\n", data);
} }
#ifndef _MANAGED
mono_thread_detach(mono_thread_current());
#endif
} }
SWITCH_STANDARD_API(managedreload_api_function) SWITCH_STANDARD_API(managedreload_api_function)
...@@ -412,9 +430,15 @@ SWITCH_STANDARD_API(managedreload_api_function) ...@@ -412,9 +430,15 @@ SWITCH_STANDARD_API(managedreload_api_function)
stream->write_function(stream, "-ERR no args specified!\n"); stream->write_function(stream, "-ERR no args specified!\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
#ifndef _MANAGED
mono_thread_attach(globals.domain);
#endif
if (!(reloadDelegate(cmd))) { if (!(reloadDelegate(cmd))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Execute failed for %s (unknown module or exception).\n", cmd); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Execute failed for %s (unknown module or exception).\n", cmd);
} }
#ifndef _MANAGED
mono_thread_detach(mono_thread_current());
#endif
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论