#include <stdio.h>
#include <pthread.h>

void hallo(void *name)
{
  int i;
  for(i=0; i<500; i++)
     printf("%d : %s sagt Hallo!\n",i ,(char *)name);
  pthread_exit((void *) 0);
}


int main()
{
 pthread_t t1, t2;

  if(pthread_create(&t1, NULL, (void *)&hallo, (void *)"Thread 1") != 0)
    {
      fprintf(stderr, "Fehler bei Thread 1......\n");
      exit(0);
    }
  if(pthread_create(&t2, NULL, (void *)&hallo, (void *)"Thread 2") != 0)
   {
      fprintf(stderr, "Fehler bei Thread 1......\n");
      exit(0);
   }
  pthread_join(t1, NULL);
  pthread_join(t2, NULL);

  return 0;
}