switch to std::lock_guard