summaryrefslogtreecommitdiff
path: root/examples/kernel
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-10-26 03:36:13 +0000
committer[email protected] <[email protected]>2012-10-26 03:36:13 +0000
commit6fe2afed8ca4deaa94cc9f8795fb8dcd7e880225 (patch)
tree789cfbb616d3bb80cf95034e7bf77ac326b62adf /examples/kernel
parent2cdbbf8b0536b60ac931b7f401f731a4f560c37b (diff)
for rt-thread 1.1.0
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2372 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'examples/kernel')
-rw-r--r--examples/kernel/thread_delete.c2
-rw-r--r--examples/kernel/thread_same_priority.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/examples/kernel/thread_delete.c b/examples/kernel/thread_delete.c
index a394f282d0..4c8336ca5d 100644
--- a/examples/kernel/thread_delete.c
+++ b/examples/kernel/thread_delete.c
@@ -131,7 +131,7 @@ int _tc_thread_delete()
tc_cleanup(_tc_cleanup);
thread_delete_init();
- return 25;
+ return 27;
}
FINSH_FUNCTION_EXPORT(_tc_thread_delete, a thread delete example);
#else
diff --git a/examples/kernel/thread_same_priority.c b/examples/kernel/thread_same_priority.c
index 3c1d91ddf9..228990ba1a 100644
--- a/examples/kernel/thread_same_priority.c
+++ b/examples/kernel/thread_same_priority.c
@@ -6,8 +6,8 @@ static struct rt_thread thread2;
static char thread1_stack[THREAD_STACK_SIZE];
static char thread2_stack[THREAD_STACK_SIZE];
-static rt_uint32_t t1_count = 0;
-static rt_uint32_t t2_count = 0;
+volatile static rt_uint32_t t1_count = 0;
+volatile static rt_uint32_t t2_count = 0;
static void thread1_entry(void* parameter)
{
while (1)
@@ -65,8 +65,12 @@ static void _tc_cleanup()
/* unlock scheduler */
rt_exit_critical();
+ rt_kprintf("t1_count=%d t2_count=%d\n",t1_count,t2_count);
+
if (t1_count / t2_count != 2)
tc_stat(TC_STAT_END | TC_STAT_FAILED);
+ else
+ tc_done(TC_STAT_PASSED);
}
int _tc_thread_same_priority()