start conversion to modern C++11.
move to std::mutex.
move to std::thread.