c pthread_join code example
Example: c why do we have to use pthread_join
The pthread_join() function provides a simple mechanism allowing an
application to wait for a thread to terminate.
After the thread terminates, the application may then choose to
clean up resources that were used by the thread.