Why do we need pthread_join?
In simple words pthread_join makes the calling thread wait till the newly created thread returns. How this helps? Let’s take an example as below:
#include #include #include #include /* Prototypes */ void * thread_func1(void *); void * thread_func2(void *); void manipVal(int); int var = 0; pthread_mutex_t m; void * thread_func1(void *arg) { printf("Hello World again\n"); } void * thread_func2(void…
View On WordPress















