Glossary: C++ Beyond the Basics
Lock guard
Also written: std::lock_guard, lock_guard
`std::lock_guard` locks a mutex when created and unlocks it when destroyed, so an exception can't leave it locked.
Glossary: C++ Beyond the Basics
Also written: std::lock_guard, lock_guard
`std::lock_guard` locks a mutex when created and unlocks it when destroyed, so an exception can't leave it locked.