Is it possible to set a timeout for a call to std::thread::join()? I want to handle the case in which the thread is taking too long to run, or terminate the th
std::thread::join()
Instead of using threads explicitly you can use std::async() to provide you with a std::future<> and you can do timed waits on the std::future:
std::async()
std::future<>
std::future
http://en.cppreference.com/w/cpp/thread/future/wait_for