Preventing deadlock with std::lock_guard in modern C++ | Introduction to Concurrency in Cpp