std::thread compatibility fix