Create and run a thread and join between threads.