I have a question about C concurrency programming.
In the pthread library, the prototype of pthread_join
is
int pthread_join(pthread_t tid, void **ret);
and the prototype of pthread_exit
is:
void pthread_exit(void *ret);
So I am confused that, why pthread_join
takes the return value of the process as a pointer to a void
pointer from reaped thread, but pthread_exit
only takes a void
pointer from the exited thread? I mean basically they are all return values from a thread, why there is a difference in type?