diff options
| author | Miguel <m.i@gmx.at> | 2018-09-28 11:13:06 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-28 11:13:06 +0200 |
| commit | 5f6c2bcf0d2f9c416134aba224d90a605f216818 (patch) | |
| tree | 6fda812ecd1ce06f743c292f3d0495d0b2941bbd /userspace/threading.c | |
| parent | 4ddca59e2c07a98988ffb07571d2b35c4c90f5ac (diff) | |
struggling with scheduler and userprog to view ppm files
Diffstat (limited to 'userspace/threading.c')
| -rw-r--r-- | userspace/threading.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/userspace/threading.c b/userspace/threading.c index 2ceaad3..2fd3b5e 100644 --- a/userspace/threading.c +++ b/userspace/threading.c @@ -1,17 +1,31 @@ #include <stdio.h> #include "newcalls.h" +volatile unsigned int c=0xbeef; + +int inc(int i) +{ + i++; + if(i==0)i=1; + return i; +} + int main() { - int thread=_clone(); // we want two threads + + int thread=_clone(); if(thread!=0) // thread 1 { - while(1) printf("a\n"); + while(1) + { + c++; + } } + else // thread2 { - while(1) printf("b\n"); + while(1) printf("0x%08x\n",c); } } |
