summaryrefslogtreecommitdiff
path: root/components/thread
diff options
context:
space:
mode:
authorqiuyiuestc <[email protected]>2010-04-11 16:44:54 +0000
committerqiuyiuestc <[email protected]>2010-04-11 16:44:54 +0000
commit5211e7ff8fbd9dd7737fa5c0d83b505bbba0c893 (patch)
treef552be8b7119d85590dc55987fd01c7ebc97d944 /components/thread
parentca6a1a7ecbd47f45b00aac9766b8dfb572c6eade (diff)
add module feature
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@604 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/thread')
-rw-r--r--components/thread/module_thread_dynamic.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/components/thread/module_thread_dynamic.c b/components/thread/module_thread_dynamic.c
new file mode 100644
index 0000000000..7a5d3238ce
--- /dev/null
+++ b/components/thread/module_thread_dynamic.c
@@ -0,0 +1,23 @@
+#include <rtthread.h>
+
+static void thread_entry(void* parameter)
+{
+ rt_kprintf("thread dynamicly created ok\n");
+ rt_thread_delay(10);
+ rt_kprintf("thread exit\n");
+}
+
+int rtm_main()
+{
+ rt_thread_t tid;
+
+ tid = rt_thread_create("test",
+ thread_entry, RT_NULL,
+ THREAD_STACK_SIZE, THREAD_PRIORITY, THREAD_TIMESLICE);
+ if (tid != RT_NULL)
+ rt_thread_startup(tid);
+ else
+ tc_stat(TC_STAT_END | TC_STAT_FAILED);
+
+ return 0;
+} \ No newline at end of file