why pthread_join didn't block its calling thread
I am learning how to use <pthread.h>, and the textbook says that: The pthread_join function blocks the calling thread … But in my test, it didn’t: void *a_thread(void *pt) { puts("a_thread:join"); pthread_join(*(pthread_t *)pt, NULL); // <– a_thread didn’t wait for puts("a_thread:joined"); // itself to finish executing. return NULL; } int main(void) { pthread_t t; puts("create");… Read More why pthread_join didn't block its calling thread