variable number of locks c++ code example Example: c++ lock #include <mutex> std::mutex mtx; mtx.lock(); //Code here mtx.unlock();