summaryrefslogtreecommitdiff
path: root/userspace/threading.c
blob: 2fd3b5e8222f81a8e3ef9b0a24b602c7de917409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#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(); 

    if(thread!=0) // thread 1
    {
      while(1)
      {
          c++;
      }
    }

    else // thread2
    {
      while(1) printf("0x%08x\n",c);
    }

}