Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
MutexedVariable< T > Class Template Reference

#include <thread.h>

+ Collaboration diagram for MutexedVariable< T >:

Public Member Functions

 MutexedVariable (const T &value)
 
get ()
 
void set (const T &value)
 

Public Attributes

m_value
 

Private Attributes

std::mutex m_mutex
 

Constructor & Destructor Documentation

◆ MutexedVariable()

template<typename T >
MutexedVariable< T >::MutexedVariable ( const T & value)
inline

Member Function Documentation

◆ get()

template<typename T >
T MutexedVariable< T >::get ( )
inline

References MutexedVariable< T >::m_mutex, and MutexedVariable< T >::m_value.

Referenced by Server::step().

+ Here is the caller graph for this function:

◆ set()

template<typename T >
void MutexedVariable< T >::set ( const T & value)
inline

References MutexedVariable< T >::m_mutex, and MutexedVariable< T >::m_value.

Referenced by Server::setAsyncFatalError().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_mutex

template<typename T >
std::mutex MutexedVariable< T >::m_mutex
private

◆ m_value

template<typename T >
T MutexedVariable< T >::m_value

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