// This code is execerpted from www.cse.nau.edu/~mc8/Thread/Hello_World.html
//HelloWorld.C
// Super Easy Hello world threads program
// that anyone can understand
#include <pthread.h>//Gimme thread stuff
#include <iostream.h>
#include <stdlib.h>

//O.K. We Need a prototype for a function to pass to
//our thread and it must be of form
// void *MyThreadFunc(void* );
void* MyThreadFunc(void *arg);

//Time for the main function
int main(){
  //Gimme a thread!!
  pthread_t aThread;//thanks 

  //Finally lets create the thread and tell it to use MyThreadFunc
  //as the thread function
  pthread_create(&aThread, NULL, MyThreadFunc, NULL); 

  //Allows us to wait for the thread to exit
  pthread_join(aThread, NULL); 

  cout<<"Exiting main\n";
  return 0;
}


void* MyThreadFunc(void* arg){

  cout<<"Hello World from inside a thread!\n"; 
  return NULL; 
} 
