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

#include <thread.h>

+ Collaboration diagram for MutexedVariable< T >:

Public Member Functions

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

Private Attributes

m_value
 
std::mutex m_mutex
 

Constructor & Destructor Documentation

◆ MutexedVariable() [1/3]

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

◆ MutexedVariable() [2/3]

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

◆ MutexedVariable() [3/3]

template<typename T >
MutexedVariable< T >::MutexedVariable ( 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::AsyncRunStep(), and Server::step().

+ Here is the caller graph for this function:

◆ set() [1/2]

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

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

Referenced by clearTextureNameCache(), and Server::setAsyncFatalError().

+ Here is the caller graph for this function:

◆ set() [2/2]

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

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
private

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