mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-14 04:54:49 +00:00
don't restart runtime functions when shutting down
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16008 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
621b76270f
commit
5c86f214b9
@ -53,6 +53,7 @@ struct switch_loadable_module {
|
|||||||
switch_memory_pool_t *pool;
|
switch_memory_pool_t *pool;
|
||||||
switch_status_t status;
|
switch_status_t status;
|
||||||
switch_thread_t *thread;
|
switch_thread_t *thread;
|
||||||
|
switch_bool_t shutting_down;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct switch_loadable_module_container {
|
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(thread != NULL);
|
||||||
switch_assert(module != 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();
|
status = module->switch_module_runtime();
|
||||||
}
|
}
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Thread ended for %s\n", module->module_interface->module_name);
|
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;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module->shutting_down = SWITCH_TRUE;
|
||||||
|
|
||||||
if (shutdown) {
|
if (shutdown) {
|
||||||
switch_loadable_module_unprocess(module);
|
switch_loadable_module_unprocess(module);
|
||||||
if (module->switch_module_shutdown) {
|
if (module->switch_module_shutdown) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user