#ifndef LLARP_THREADPOOL_HPP #define LLARP_THREADPOOL_HPP #include #include #include #include #include #include namespace llarp { namespace thread { typedef std::mutex mtx_t; typedef std::unique_lock lock_t; struct Pool { Pool(size_t sz); void QueueJob(const llarp_thread_job& job); void Join(); void Stop(); std::vector threads; std::deque jobs; mtx_t queue_mutex; std::condition_variable condition; std::condition_variable done; bool stop; }; } // namespace thread } // namespace llarp #endif