Permalink
Browse files

Merge branch 'master' of github.com:ShaoYuZhang/choochoo

  • Loading branch information...
2 parents 02864d8 + 6cbfcfb commit ba270c8d733db7ef24bb8fe19600880143772ac9 s54zhang committed May 22, 2012
Showing with 26 additions and 0 deletions.
  1. +19 −0 kernel/demo_task.c
  2. +7 −0 kernel/demo_task.h
View
@@ -0,0 +1,19 @@
+#include <bwio.h>
+#include <syscall.h>
+
+void task2() {
+ bwprintf(COM2, "task id: %d, parent's task id: %d\n", MyTid(), MyParentsTid());
+ Pass();
+ bwprintf(COM2, "task id: %d, parent's task id: %d\n", MyTid(), MyParentsTid());
+ bwprintf(COM2, "Second: exiting\n");
+ Exit();
+}
+
+void task1() {
+ for (int i = 0; i < 4; i++) {
+ int priority = 2 * (i >> 1);
+ bwprintf(COM2, "Created: %d\n", Create(priority, task2));
+ }
+ bwprintf(COM2, "First: exiting\n");
+ Exit();
+}
View
@@ -0,0 +1,7 @@
+#ifndef DEMO_TASK_H
+#define DEMO_TASK_H
+
+void task1();
+void task2();
+
+#endif

0 comments on commit ba270c8

Please sign in to comment.