pthread_join must exist in the same function with pthread_create.