Derecho  0.9
Distributed systems toolkit for RDMA
Public Member Functions | Private Attributes | List of all members
derecho::LockedReference< LockType, T > Class Template Reference

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
 

Detailed Description

template<typename LockType, typename T>
class derecho::LockedReference< LockType, T >

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.

Constructor & Destructor Documentation

◆ LockedReference()

template<typename LockType, typename T>
derecho::LockedReference< LockType, T >::LockedReference ( T &  real_reference,
typename LockType::mutex_type &  mutex 
)
inline

Definition at line 26 of file locked_reference.hpp.

Member Function Documentation

◆ get()

template<typename LockType, typename T>
T& derecho::LockedReference< LockType, T >::get ( )
inline

Definition at line 29 of file locked_reference.hpp.

Member Data Documentation

◆ lock

template<typename LockType, typename T>
LockType derecho::LockedReference< LockType, T >::lock
private

Definition at line 23 of file locked_reference.hpp.

◆ reference

template<typename LockType, typename T>
T& derecho::LockedReference< LockType, T >::reference
private

Definition at line 22 of file locked_reference.hpp.


The documentation for this class was generated from the following file: