A little helper class that wraps together a reference and a lock on a related mutex. More...
#include <locked_reference.hpp>
Public Member Functions | |
LockedReference (T &real_reference, typename LockType::mutex_type &mutex) | |
T & | get () |
Private Attributes | |
T & | reference |
LockType | lock |
A little helper class that wraps together a reference and a lock on a related mutex.
This keeps the lock in scope as long as a client has access to the reference, which ensures that the mutex stays locked while the data it guards is being accessed.
Definition at line 20 of file locked_reference.hpp.
|
inline |
Definition at line 26 of file locked_reference.hpp.
|
inline |
Definition at line 29 of file locked_reference.hpp.
|
private |
Definition at line 23 of file locked_reference.hpp.
|
private |
Definition at line 22 of file locked_reference.hpp.