#include <stdio.h>
#include <pthread.h>

pthread_t t1;  /* thread process descriptor */

/**
 * hello-world.c
 *
 * My first C program
 * No parallel code - just a print
 * on the screen
 * you can called it like hello-world 1 3 4 fsd "et argument"
 */

void * thread_body(void * aparm)
{
  int i;  
  for (i=0;i<3; i++)
    {
      printf("loop nr %i\n",i);
      sleep(1);
    }
}

int main(int argc, char *argv[])
{
  int i;
  int res;
  printf("\nHello out there\n");
  printf("I have been called with %i parms\n", argc);
  
  printf("creating a thread NOW\n");
  
  res = pthread_create(&t1,NULL,thread_body,NULL);
  for (i=0;i<argc;i++) 
    {
      printf("arg %i: %s\n",i,argv[i]);
    }
  sleep(10);
}

