summaryrefslogtreecommitdiff
path: root/src/modules/test
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-01 10:39:33 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-01 10:39:33 +0200
commit66b32658d2e5aa99493dcb3abcb73cdb2cc6f0b5 (patch)
tree3b728f4c8dc93f6ab9237af3d32410346b617ae8 /src/modules/test
parent07b15b375ee7cc87f476200b2fd6205959ac0ba4 (diff)
downloadTCE-66b32658d2e5aa99493dcb3abcb73cdb2cc6f0b5.tar.gz
TCE-66b32658d2e5aa99493dcb3abcb73cdb2cc6f0b5.zip
It's alive! Or is it? No, it's not.
Diffstat (limited to 'src/modules/test')
-rw-r--r--src/modules/test/main.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/modules/test/main.c b/src/modules/test/main.c
index 26ff840..6c13e5a 100644
--- a/src/modules/test/main.c
+++ b/src/modules/test/main.c
@@ -6,27 +6,33 @@ void thread_cascade(void* d) {
int n = (int)d;
if (d == 0) {
- printk("{#} 0 cascade element started => end\n");
+ //printk("{#} 0 cascade element started => end\n");
+ printk("{#}0end\t");
} else {
if (n < 0) {
- printk("{#} - cascade element started\n");
+ //printk("{#} - cascade element started\n");
+ printk("{#}-\t");
n = 0 - n;
} else {
- printk("{#} + cascade element started\n");
+ //printk("{#} + cascade element started\n");
+ printk("{#}+\t");
}
- printk("{#} FORK + ...\n");
+ //printk("{#} FORK + ...\n");
+ printk("{#}F+\t");
thread_new(thread_cascade, (void*)(n - 1));
- printk("{#} FORK - ...\n");
+ //printk("{#} FORK - ...\n");
+ printk("{#}F-\t");
thread_new(thread_cascade, (void*)(1 - n));
- printk("{#} Thread cascade element finished.\n");
+ //printk("{#} Thread cascade element finished.\n");
+ printk("{#}end\t");
}
}
int main() {
printk("Hi world from test module !\n");
- printk("{1} Creating thread cascade len:1\n");
- thread_new(thread_cascade, (void*)1);
+ printk("{1} Creating thread cascade len:5\n");
+ thread_new(thread_cascade, (void*)5);
printk("{1} Thread now sleeping...\n");
while (1) thread_sleep(1000);