/** * */ #ifndef EASY_PROFILER_THREAD_POOL_H #define EASY_PROFILER_THREAD_POOL_H #include "thread_pool_task.h" #include #include #include #include class ThreadPool EASY_FINAL { friend ThreadPoolTask; std::vector m_threads; std::deque > m_tasks; std::mutex m_mutex; std::condition_variable m_cv; std::atomic_bool m_interrupt; ThreadPool(); public: ~ThreadPool(); static ThreadPool& instance(); private: void enqueue(ThreadPoolTask& task); void dequeue(ThreadPoolTask& task); void work(); }; // end of class ThreadPool. #endif //EASY_PROFILER_THREAD_POOL_H