![]() |
Shkyera Engine
Easy to use, game engine for Python
|
#include <ThreadWorker.hpp>
Public Member Functions | |
| ThreadWorker () | |
| ~ThreadWorker () | |
| void | run () |
Private Attributes | |
| std::thread | _thread |
| std::atomic< bool > | _stop {false} |
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.
| shkyera::ThreadWorker::ThreadWorker | ( | ) |
Constructs a new worker thread and starts it. The thread will begin pulling and executing jobs immediately.
| shkyera::ThreadWorker::~ThreadWorker | ( | ) |
Destroys the worker thread and ensures proper cleanup. This will stop the worker thread and wait for it to finish.
| 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.
|
private |