C++11 code using std::thread.