summaryrefslogtreecommitdiff
path: root/userspace/threading.c
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-28 11:13:06 +0200
committerMiguel <m.i@gmx.at>2018-09-28 11:13:06 +0200
commit5f6c2bcf0d2f9c416134aba224d90a605f216818 (patch)
tree6fda812ecd1ce06f743c292f3d0495d0b2941bbd /userspace/threading.c
parent4ddca59e2c07a98988ffb07571d2b35c4c90f5ac (diff)
struggling with scheduler and userprog to view ppm files
Diffstat (limited to 'userspace/threading.c')
-rw-r--r--userspace/threading.c20
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);
}
}