#include<stdio.h>
#include<thread.h>
#include<stdlib.h>
int x=0;
void *ft() {
  int i;
  for(i=1;i<=1000;i++)
    x+=1;
}
main() {
  int thid1,thid2,thid3,thid4;
  thr_create(NULL,0,ft,NULL,0,&thid1);
  thr_create(NULL,0,ft,NULL,0,&thid2);
  thr_create(NULL,0,ft,NULL,0,&thid3);
  thr_create(NULL,0,ft,NULL,0,&thid4);
  thr_join(NULL,NULL,NULL);
  printf("this is x= %d",x);
}
