Minetest  5.4.0
MutexedQueue< T > Class Template Reference

#include <container.h>

+ Inheritance diagram for MutexedQueue< T >:
+ Collaboration diagram for MutexedQueue< T >:

Public Member Functions

 MutexedQueue ()=default
 
bool empty () const
 
void push_back (T t)
 
pop_frontNoEx (u32 wait_time_max_ms)
 
pop_front (u32 wait_time_max_ms)
 
pop_frontNoEx ()
 
pop_back (u32 wait_time_max_ms=0)
 
pop_backNoEx (u32 wait_time_max_ms)
 
pop_backNoEx ()
 

Protected Member Functions

std::mutex & getMutex ()
 
std::deque< T > & getQueue ()
 

Protected Attributes

std::deque< T > m_queue
 
std::mutex m_mutex
 
Semaphore m_signal
 

Friends

template<typename Key , typename U , typename Caller , typename CallerData >
class RequestQueue
 

Constructor & Destructor Documentation

◆ MutexedQueue()

template<typename T >
MutexedQueue< T >::MutexedQueue ( )
default

Member Function Documentation

◆ empty()

template<typename T >
bool MutexedQueue< T >::empty ( ) const
inline

References MutexedQueue< T >::m_mutex, and MutexedQueue< T >::m_queue.

Referenced by Client::~Client(), Server::AsyncRunStep(), RequestQueue< Key, T, Caller, CallerData >::empty(), and Client::step().

+ Here is the caller graph for this function:

◆ getMutex()

template<typename T >
std::mutex& MutexedQueue< T >::getMutex ( )
inlineprotected

References MutexedQueue< T >::m_mutex.

Referenced by RequestQueue< Key, T, Caller, CallerData >::add().

+ Here is the caller graph for this function:

◆ getQueue()

template<typename T >
std::deque<T>& MutexedQueue< T >::getQueue ( )
inlineprotected

References MutexedQueue< T >::m_queue.

Referenced by RequestQueue< Key, T, Caller, CallerData >::add().

+ Here is the caller graph for this function:

◆ pop_back()

template<typename T >
T MutexedQueue< T >::pop_back ( u32  wait_time_max_ms = 0)
inline

References MutexedQueue< T >::m_mutex, MutexedQueue< T >::m_queue, MutexedQueue< T >::m_signal, and Semaphore::wait().

+ Here is the call graph for this function:

◆ pop_backNoEx() [1/2]

template<typename T >
T MutexedQueue< T >::pop_backNoEx ( )
inline

References MutexedQueue< T >::m_mutex, MutexedQueue< T >::m_queue, MutexedQueue< T >::m_signal, and Semaphore::wait().

+ Here is the call graph for this function:

◆ pop_backNoEx() [2/2]

template<typename T >
T MutexedQueue< T >::pop_backNoEx ( u32  wait_time_max_ms)
inline

References MutexedQueue< T >::m_mutex, MutexedQueue< T >::m_queue, MutexedQueue< T >::m_signal, and Semaphore::wait().

+ Here is the call graph for this function:

◆ pop_front()

template<typename T >
T MutexedQueue< T >::pop_front ( u32  wait_time_max_ms)
inline

References MutexedQueue< T >::m_mutex, MutexedQueue< T >::m_queue, MutexedQueue< T >::m_signal, and Semaphore::wait().

Referenced by CItemDefManager::getClientCached(), TextureSource::getTextureId(), and RequestQueue< Key, T, Caller, CallerData >::pop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pop_frontNoEx() [1/2]

template<typename T >
T MutexedQueue< T >::pop_frontNoEx ( )
inline

References MutexedQueue< T >::m_mutex, MutexedQueue< T >::m_queue, MutexedQueue< T >::m_signal, and Semaphore::wait().

+ Here is the call graph for this function:

◆ pop_frontNoEx() [2/2]

template<typename T >
T MutexedQueue< T >::pop_frontNoEx ( u32  wait_time_max_ms)
inline

References MutexedQueue< T >::m_mutex, MutexedQueue< T >::m_queue, MutexedQueue< T >::m_signal, and Semaphore::wait().

Referenced by Client::~Client(), Server::AsyncRunStep(), ShaderSource::getShader(), RequestQueue< Key, T, Caller, CallerData >::pop(), and Client::step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ push_back()

template<typename T >
void MutexedQueue< T >::push_back ( t)
inline

References MutexedQueue< T >::m_mutex, MutexedQueue< T >::m_queue, MutexedQueue< T >::m_signal, and Semaphore::post().

Referenced by RequestQueue< Key, T, Caller, CallerData >::add(), Server::AsyncRunStep(), Server::DeleteClient(), MeshUpdateThread::doUpdate(), Server::handleAdminChat(), TermLogOutput::log(), TermLogOutput::logRaw(), Server::notifyPlayer(), and Server::printToConsoleOnly().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ RequestQueue

template<typename T >
template<typename Key , typename U , typename Caller , typename CallerData >
friend class RequestQueue
friend

Member Data Documentation

◆ m_mutex

◆ m_queue

◆ m_signal


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