提交 ee11663d 编写于 作者: B bernard.xiong@gmail.com

remove rt_current_module and user can use rt_module_unload to remove a module.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2458 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 0f72824e
......@@ -131,7 +131,9 @@ void rt_thread_idle_excute(void)
#ifdef RT_USING_MODULE
if (module != RT_NULL)
{
{
extern rt_err_t rt_module_destroy(rt_module_t module);
/* if sub thread list and main thread are all empty */
if ((module->module_thread == RT_NULL) &&
rt_list_isempty(&module->module_object[RT_Object_Class_Thread].object_list) )
......@@ -139,9 +141,9 @@ void rt_thread_idle_excute(void)
module->nref --;
}
/* unload module */
/* destroy module */
if (module->nref == 0)
rt_module_unload(module);
rt_module_destroy(module);
}
#endif
}
......
此差异已折叠。
......@@ -266,11 +266,6 @@ void rt_schedule(void)
from_thread = rt_current_thread;
rt_current_thread = to_thread;
#ifdef RT_USING_MODULE
rt_module_set((rt_current_thread->module_id != RT_NULL) ?
(rt_module_t)rt_current_thread->module_id : RT_NULL);
#endif
RT_OBJECT_HOOK_CALL(rt_scheduler_hook, (from_thread, to_thread));
/* switch to new thread */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册