Replace NSThread by std::thread