usage of pthread_exit and pthread_join