提交 3aab8c54 编写于 作者: M mazhiyuan

format thread_tc.c

上级 c3465dfa
...@@ -20,12 +20,12 @@ ALIGN(RT_ALIGN_SIZE) ...@@ -20,12 +20,12 @@ ALIGN(RT_ALIGN_SIZE)
static char thread2_stack[1024]; static char thread2_stack[1024];
static struct rt_thread thread2; static struct rt_thread thread2;
#ifdef RT_USING_HEAP #ifdef RT_USING_HEAP
static rt_thread_t tid1 = RT_NULL; static rt_thread_t tid1 = RT_NULL;
static rt_thread_t tid3 = RT_NULL; static rt_thread_t tid3 = RT_NULL;
static rt_thread_t tid4 = RT_NULL; static rt_thread_t tid4 = RT_NULL;
static rt_thread_t tid5 = RT_NULL; static rt_thread_t tid5 = RT_NULL;
static rt_thread_t tid6 = RT_NULL; static rt_thread_t tid6 = RT_NULL;
static rt_thread_t tid7 = RT_NULL; static rt_thread_t tid7 = RT_NULL;
#endif /* RT_USING_HEAP */ #endif /* RT_USING_HEAP */
static rt_uint32_t tid3_delay_pass_flag = 0; static rt_uint32_t tid3_delay_pass_flag = 0;
...@@ -35,16 +35,16 @@ static rt_uint32_t tid6_finish_flag = 0; ...@@ -35,16 +35,16 @@ static rt_uint32_t tid6_finish_flag = 0;
static rt_uint32_t thread5_source = 0; static rt_uint32_t thread5_source = 0;
#ifndef RT_USING_SMP #ifndef RT_USING_SMP
static rt_uint32_t thread_yield_flag = 0; static rt_uint32_t thread_yield_flag = 0;
#endif #endif
static rt_uint32_t entry_idle_hook_times = 0; static rt_uint32_t entry_idle_hook_times = 0;
static rt_thread_t __current_thread; static rt_thread_t __current_thread;
static rt_uint8_t change_priority; static rt_uint8_t change_priority;
static rt_uint32_t count = 0; static rt_uint32_t count = 0;
void thread1_entry(void* param) void thread1_entry(void *param)
{ {
while(1); while (1);
} }
static void test_dynamic_thread(void) static void test_dynamic_thread(void)
...@@ -54,7 +54,7 @@ static void test_dynamic_thread(void) ...@@ -54,7 +54,7 @@ static void test_dynamic_thread(void)
tid1 = rt_thread_create("thread1", tid1 = rt_thread_create("thread1",
thread1_entry, thread1_entry,
(void*)1, (void *)1,
THREAD_STACK_SIZE, THREAD_STACK_SIZE,
__current_thread->current_priority + 1, __current_thread->current_priority + 1,
THREAD_TIMESLICE - 5); THREAD_TIMESLICE - 5);
...@@ -65,7 +65,7 @@ static void test_dynamic_thread(void) ...@@ -65,7 +65,7 @@ static void test_dynamic_thread(void)
} }
ret_startup = rt_thread_startup(tid1); ret_startup = rt_thread_startup(tid1);
if(ret_startup != RT_EOK) if (ret_startup != RT_EOK)
{ {
uassert_false(ret_startup != RT_EOK); uassert_false(ret_startup != RT_EOK);
goto __exit; goto __exit;
...@@ -88,9 +88,9 @@ __exit: ...@@ -88,9 +88,9 @@ __exit:
return; return;
} }
void thread2_entry(void* param) void thread2_entry(void *param)
{ {
while(1); while (1);
} }
static void test_static_thread(void) static void test_static_thread(void)
...@@ -102,7 +102,7 @@ static void test_static_thread(void) ...@@ -102,7 +102,7 @@ static void test_static_thread(void)
ret_init = rt_thread_init(&thread2, ret_init = rt_thread_init(&thread2,
"thread2", "thread2",
thread2_entry, thread2_entry,
(void*)2, (void *)2,
&thread2_stack[0], &thread2_stack[0],
sizeof(thread2_stack), sizeof(thread2_stack),
__current_thread->current_priority + 1, __current_thread->current_priority + 1,
...@@ -389,7 +389,7 @@ static void test_thread_priority(void) ...@@ -389,7 +389,7 @@ static void test_thread_priority(void)
} }
count = 0; count = 0;
ret_startup = rt_thread_startup(tid8); ret_startup = rt_thread_startup(tid8);
if(ret_startup != RT_EOK) if (ret_startup != RT_EOK)
{ {
uassert_false(ret_startup != RT_EOK); uassert_false(ret_startup != RT_EOK);
return ; return ;
...@@ -458,7 +458,7 @@ static void test_delay_until(void) ...@@ -458,7 +458,7 @@ static void test_delay_until(void)
#ifndef RT_USING_SMP #ifndef RT_USING_SMP
static volatile rt_uint32_t yield_count; static volatile rt_uint32_t yield_count;
static void test_thread_yield_inc_entry(void* parameter) static void test_thread_yield_inc_entry(void *parameter)
{ {
rt_uint32_t loop = 0; rt_uint32_t loop = 0;
...@@ -471,7 +471,7 @@ static void test_thread_yield_inc_entry(void* parameter) ...@@ -471,7 +471,7 @@ static void test_thread_yield_inc_entry(void* parameter)
} }
} }
static void test_thread_yield_entry(void* parameter) static void test_thread_yield_entry(void *parameter)
{ {
rt_err_t ret_startup = -RT_ERROR; rt_err_t ret_startup = -RT_ERROR;
...@@ -541,13 +541,14 @@ void test_thread_yield_nosmp(void) ...@@ -541,13 +541,14 @@ void test_thread_yield_nosmp(void)
static rt_uint32_t thread9_count = 0; static rt_uint32_t thread9_count = 0;
static void thread9_entry(void *parameter) static void thread9_entry(void *parameter)
{ {
while(1) while (1)
{ {
thread9_count ++; thread9_count ++;
} }
} }
static void test_thread_suspend(void){ static void test_thread_suspend(void)
{
static rt_thread_t tid; static rt_thread_t tid;
rt_err_t ret_startup = -RT_ERROR; rt_err_t ret_startup = -RT_ERROR;
uint32_t count_before_suspend, count_before_resume, count_after_resume; uint32_t count_before_suspend, count_before_resume, count_after_resume;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册