![]() |
mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
Convenience class for safe and expressive management of mutexed variables. More...
#include <lockable.h>
Convenience class for safe and expressive management of mutexed variables.
In the typical use-case, instantiate this class with a struct holding all variables that you want locked together.
To access these variables, unlock the object with the specialized RAII-style object Unlocker (see below in this file) - similar to how you'd use an std::scoped_lock. Or you can use the familiar set_mutexed() and get_mutexed() methods.