29 void start()
override;
31 size_t size()
const override;
Thread-safe queue for inter-thread communication.
Interface for a thread pool.
std::function< void()> Task
Concrete implementation of IThreadPool.
size_t size() const override
Get the number of threads in the pool.
std::vector< std::jthread > _workers
void stop() override
Stop all threads and clean up resources.
void _workerLoop(std::stop_token stopToken)
Worker thread main loop Continuously pulls tasks from the queue and executes them.
void enqueue(Task task) override
Enqueue a task to be executed by the thread pool.
void start() override
Start all threads in the pool.
ThreadSafeQueue< Task > _taskQueue