To wait for a thread use the std::thread::join() function . This function makes the current thread wait until the thread identified by *this has finished executing.
To wait for a thread use the std::thread::join() function . This function makes the current thread wait until the thread identified by *this has finished executing.