提交 5c86f214 authored 作者: Mathieu Rene's avatar Mathieu Rene

don't restart runtime functions when shutting down

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16008 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 621b7627
......@@ -53,6 +53,7 @@ struct switch_loadable_module {
switch_memory_pool_t *pool;
switch_status_t status;
switch_thread_t *thread;
switch_bool_t shutting_down;
};
struct switch_loadable_module_container {
......@@ -90,7 +91,7 @@ static void *SWITCH_THREAD_FUNC switch_loadable_module_exec(switch_thread_t *thr
switch_assert(thread != NULL);
switch_assert(module != NULL);
for (restarts = 0; status != SWITCH_STATUS_TERM; restarts++) {
for (restarts = 0; status != SWITCH_STATUS_TERM && !module->shutting_down; restarts++) {
status = module->switch_module_runtime();
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Thread ended for %s\n", module->module_interface->module_name);
......@@ -1257,6 +1258,8 @@ static switch_status_t do_shutdown(switch_loadable_module_t *module, switch_bool
return SWITCH_STATUS_FALSE;
}
module->shutting_down = SWITCH_TRUE;
if (shutdown) {
switch_loadable_module_unprocess(module);
if (module->switch_module_shutdown) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论