Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
UpdateThread Class Referenceabstract

#include <thread.h>

+ Inheritance diagram for UpdateThread:
+ Collaboration diagram for UpdateThread:

Public Member Functions

 UpdateThread (const std::string &name)
 
 ~UpdateThread ()=default
 
void deferUpdate ()
 
void stop ()
 
void * run ()
 
- Public Member Functions inherited from Thread
 Thread (const std::string &name="")
 
virtual ~Thread ()
 
bool start ()
 
bool stop ()
 
bool wait ()
 
bool isCurrentThread ()
 
bool isRunning ()
 
bool stopRequested ()
 
std::thread::id getThreadId ()
 
bool getReturnValue (void **ret)
 
bool bindToProcessor (unsigned int proc_number)
 
bool setPriority (int prio)
 

Protected Member Functions

virtual void doUpdate ()=0
 

Private Attributes

Semaphore m_update_sem
 

Additional Inherited Members

- Static Public Member Functions inherited from Thread
static ThreadgetCurrentThread ()
 
static void setName (const std::string &name)
 
static unsigned int getNumberOfProcessors ()
 
- Protected Attributes inherited from Thread
std::string m_name
 

Constructor & Destructor Documentation

◆ UpdateThread()

UpdateThread::UpdateThread ( const std::string & name)
inline

◆ ~UpdateThread()

UpdateThread::~UpdateThread ( )
default

Member Function Documentation

◆ deferUpdate()

void UpdateThread::deferUpdate ( )
inline

References m_update_sem, and Semaphore::post().

Referenced by MinimapUpdateThread::enqueueBlock(), Minimap::setMinimapShape(), Minimap::setModeIndex(), Minimap::setPos(), and Minimap::toggleMinimapShape().

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

◆ doUpdate()

virtual void UpdateThread::doUpdate ( )
protectedpure virtual

Implemented in MeshUpdateWorkerThread, and MinimapUpdateThread.

Referenced by run().

+ Here is the caller graph for this function:

◆ run()

void * UpdateThread::run ( )
inlinevirtual

Implements Thread.

References BEGIN_DEBUG_EXCEPTION_HANDLER, doUpdate(), END_DEBUG_EXCEPTION_HANDLER, m_update_sem, Thread::stopRequested(), and Semaphore::wait().

+ Here is the call graph for this function:

◆ stop()

void UpdateThread::stop ( )
inline

References m_update_sem, Semaphore::post(), and Thread::stop().

Referenced by Minimap::~Minimap().

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

Member Data Documentation

◆ m_update_sem

Semaphore UpdateThread::m_update_sem
private

Referenced by deferUpdate(), run(), and stop().


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