cleanup code in ipc.c and idle.c

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1713 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
dzzxzz
2011-09-19 07:15:31 +00:00
parent 865c1d4df0
commit 405678552d
2 changed files with 88 additions and 99 deletions

View File

@@ -1,7 +1,7 @@
/*
* File : idle.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
* COPYRIGHT (C) 2006 - 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -83,7 +83,7 @@ void rt_thread_idle_excute(void)
module = (rt_module_t)thread->module_id;
/* if the thread is module's main thread */
if(module != RT_NULL && module->module_thread == thread)
if (module != RT_NULL && module->module_thread == thread)
{
/* detach module's main thread */
module->module_thread = RT_NULL;
@@ -117,7 +117,7 @@ void rt_thread_idle_excute(void)
#ifdef RT_USING_HEAP
#if defined(RT_USING_MODULE) && defined(RT_USING_SLAB)
/* the thread belongs to an application module */
if(thread->flags & RT_OBJECT_FLAG_MODULE)
if (thread->flags & RT_OBJECT_FLAG_MODULE)
rt_module_free((rt_module_t)thread->module_id, thread->stack_addr);
else
#endif
@@ -128,10 +128,10 @@ void rt_thread_idle_excute(void)
#endif
#ifdef RT_USING_MODULE
if(module != RT_NULL)
if (module != RT_NULL)
{
/* if sub thread list and main thread are all empty */
if((module->module_thread == RT_NULL) &&
if ((module->module_thread == RT_NULL) &&
rt_list_isempty(&module->module_object[RT_Object_Class_Thread].object_list) )
{
module->nref--;
@@ -139,7 +139,7 @@ void rt_thread_idle_excute(void)
}
/* unload module */
if(module->nref == 0) rt_module_unload(module);
if (module->nref == 0) rt_module_unload(module);
#endif
}
}
@@ -164,7 +164,7 @@ static void rt_thread_idle_entry(void* parameter)
*
* @note this function must be invoked when system init.
*/
void rt_thread_idle_init()
void rt_thread_idle_init(void)
{
/* init thread */
rt_thread_init(&idle,

173
src/ipc.c

File diff suppressed because it is too large Load Diff