diff --git a/src/include/switch_core.h b/src/include/switch_core.h index 3fa7dc955c..082f483c98 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -1669,7 +1669,7 @@ SWITCH_DECLARE(FILE *) switch_core_get_console(void); /*! \brief Launch a thread */ -SWITCH_DECLARE(void) switch_core_launch_thread(void *(*func) (switch_thread_t *, void *), void *obj, switch_memory_pool_t *pool); +SWITCH_DECLARE(void) switch_core_launch_thread(void *(SWITCH_THREAD_FUNC *func) (switch_thread_t *, void *), void *obj, switch_memory_pool_t *pool); /*! \brief Initiate Globals diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index 506e27fb53..db0e56bf99 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -77,7 +77,7 @@ static struct switch_loadable_module_container loadable_modules; static switch_status_t do_shutdown(switch_loadable_module_t *module, switch_bool_t shutdown, switch_bool_t unload, switch_bool_t fail_if_busy, const char **err); static switch_status_t switch_loadable_module_load_module_ex(char *dir, char *fname, switch_bool_t runtime, switch_bool_t global, const char **err); -static void *switch_loadable_module_exec(switch_thread_t *thread, void *obj) +static void *SWITCH_THREAD_FUNC switch_loadable_module_exec(switch_thread_t *thread, void *obj) { @@ -99,7 +99,7 @@ static void *switch_loadable_module_exec(switch_thread_t *thread, void *obj) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroying Pool for %s\n", module->module_interface->module_name); switch_core_destroy_memory_pool(&pool); } - switch_yield(1000000); + switch_thread_exit(thread, 0); return NULL; }