mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 02:06:14 +08:00
add more thread examples.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@459 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -10,7 +10,7 @@ static rt_uint32_t count = 0;
|
||||
/*
|
||||
* the priority of thread1 > the priority of thread2
|
||||
*/
|
||||
void thread1_entry(void* parameter)
|
||||
static void thread1_entry(void* parameter)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
@@ -21,7 +21,7 @@ void thread1_entry(void* parameter)
|
||||
}
|
||||
}
|
||||
|
||||
void thread2_entry(void* parameter)
|
||||
static void thread2_entry(void* parameter)
|
||||
{
|
||||
rt_tick_t tick;
|
||||
|
||||
@@ -43,7 +43,7 @@ void thread2_entry(void* parameter)
|
||||
int thread_priority_init()
|
||||
{
|
||||
rt_err_t result;
|
||||
|
||||
|
||||
result = rt_thread_init(&thread1,
|
||||
"t1",
|
||||
thread1_entry, RT_NULL,
|
||||
@@ -73,7 +73,7 @@ static void _tc_cleanup()
|
||||
{
|
||||
/* lock scheduler */
|
||||
rt_enter_critical();
|
||||
|
||||
|
||||
if (thread1.stat != RT_THREAD_CLOSE)
|
||||
rt_thread_detach(&thread1);
|
||||
if (thread2.stat != RT_THREAD_CLOSE)
|
||||
|
||||
Reference in New Issue
Block a user