#ifndef THREADPOOL_H #define THREADPOOL_H #include #include #include #include namespace usermode { class ThreadPool { int thread_count; bool should_terminate; std::mutex queue_mutex; std::condition_variable mutex_condition; std::vector threads; std::queue> jobs; void ThreadLoop(); public: ThreadPool( int ThreadCount ); void QueueJob(const std::function& job); void Stop(); bool Busy(); }; } #endif