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:
bernard.xiong
2010-03-03 09:12:08 +00:00
parent 51e545f575
commit 54d711a9c5
8 changed files with 427 additions and 13 deletions
+4 -4
View File
@@ -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)