What does std::thread.join() do?
You still need mutexes and conditions. Joining a thread makes one thread of execution wait for another thread to finish running. You still need mutexes to protect shared resources. It allows main() in this example to wait for all threads to finish before quitting itself. #include <iostream> #include <thread> #include <chrono> #include <mutex> using namespace … Read more