A simple pthread program runtime error in c++ 2011


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

void *thread_routine(void* arg)
{
printf("Inside newly created thread \n");
}

int main(int argc, char* argv[])
{
pthread_t thread_id;
void *thread_result;
pthread_create(&thread_id, NULL, thread_routine, NULL);
printf("Inside main thread \n");
pthread_join(thread_id, &thread_result);
}


Sponsored Links