From 7fd452b8a6859ff16762985fea8ee93b0a4dff86 Mon Sep 17 00:00:00 2001 From: qiuyiuestc Date: Sat, 25 Sep 2010 15:30:25 +0000 Subject: module update git-svn-id: https://rt-thread.googlecode.com/svn/trunk@946 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/idle.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/idle.c') diff --git a/src/idle.c b/src/idle.c index b9c8529da7..c8af8f905b 100644 --- a/src/idle.c +++ b/src/idle.c @@ -103,15 +103,7 @@ void rt_thread_idle_excute(void) { /* detach module's main thread */ module->module_thread = RT_NULL; - } - - /* if sub thread list and main thread are all enmpy */ - if((module->module_thread == RT_NULL) && - rt_list_isempty(&module->module_object[RT_Object_Class_Thread].object_list) ) - { - /* unload module */ - rt_module_unload(module); - } + } } #endif /* release thread's stack */ @@ -119,7 +111,20 @@ void rt_thread_idle_excute(void) /* delete thread object */ rt_object_delete((rt_object_t)thread); + +#ifdef RT_USING_MODULE + if(module != RT_NULL) + { + /* 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) ) + { + /* unload module */ + rt_module_unload(module); + } + } } +#endif #endif } -- cgit v1.3.1