The pthread_join() function waits for a thread to terminate, detaches the thread, then returns the threads exit status. If the status parameter is NULL, the threads exit status is not returned.
The pthread_join() function suspends execution of the calling thread until the target thread terminates, unless the target thread has already terminated. If status is non-NULL, the value passed to pthread_exit() by the terminated thread is stored in the location pointed to by status.
The pthread_exit() function terminates the calling thread and returns a value via retval that (if the thread is joinable) is available to another thread in the same process that calls pthread_join(3).
Добавить комментарий