#pragma once #include #include namespace VUtils { struct PoolWorker { virtual void run() = 0; }; class Pool { public: explicit Pool(const char *name); ~Pool(); void setThreadCount(int count); void create(PoolWorker& worker); void joinFirstThread(); protected: bool m_isCreated = false; int m_count = 1; const char *m_name = "Pool"; PoolWorker *m_worker{}; std::thread *m_threads{}; void execute(); }; }