For example, If I create 3 threads and join them in the same order. If the second thread exit first, then what would happen to the pthread_join. Will the program block until tid1 exits or directly return from pthread_join(&tid2,NULL)?
pthread_t tid1,tid2,tid3;
pthread_create(&tid1, NULL, SomeFun, NULL);
pthread_create(&tid2, NULL, SomeFun, NULL);
pthread_create(&tid3, NULL, SomeFun, NULL);
pthread_join(&tid1, NULL);
pthread_join(&tid2, NULL);
pthread_join(&tid3, NULL);
pthread_join()
is not the dreaded "come from". – EOF