Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
shkyera::ThreadWorker Class Reference

#include <ThreadWorker.hpp>

Public Member Functions

 ThreadWorker ()
 
 ~ThreadWorker ()
 
void run ()
 

Private Attributes

std::thread _thread
 
std::atomic< bool_stop {false}
 

Detailed Description

Worker thread class for executing jobs from the job system. Manages a dedicated thread that continuously pulls and executes jobs from the job system. The worker runs in a loop until stopped, processing jobs as they become available.

Constructor & Destructor Documentation

◆ ThreadWorker()

shkyera::ThreadWorker::ThreadWorker ( )

Constructs a new worker thread and starts it. The thread will begin pulling and executing jobs immediately.

◆ ~ThreadWorker()

shkyera::ThreadWorker::~ThreadWorker ( )

Destroys the worker thread and ensures proper cleanup. This will stop the worker thread and wait for it to finish.

Member Function Documentation

◆ run()

void shkyera::ThreadWorker::run ( )

Main execution loop that pulls and runs jobs. This method runs in a dedicated thread and continues until the worker is stopped.

Member Data Documentation

◆ _stop

std::atomic<bool> shkyera::ThreadWorker::_stop {false}
private

◆ _thread

std::thread shkyera::ThreadWorker::_thread
private

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