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

#define  NUM  5

void  *print_msg(void *);

int main()
{
  pthread_t t1;    /* dwa watki */
  int num = 8;


  pthread_create(&t1, NULL, print_msg, (void*)&num);
  pthread_join(t1, NULL);
  return 0;
}
void *print_msg(void * a)
{
  int i = 0;
  int *count = (int *)a;
  for (; i< *count; ++i)
  {
	  printf("%i\n", i);
	  sleep(1);
  }

  return NULL;
}
