replace thread ops with std::thread