5 #if defined(_WIN32) || defined(_WIN64)
7 #ifndef WIN32_LEAN_AND_MEAN
8 #error WIN32 LEAN AND MEAN MACRO WAS NOT DEFINED
10 #include <SDKDDKVer.h>
11 #include <boost/asio.hpp>
14 #include <boost/asio.hpp>
18 #include <boost/thread.hpp>
19 #include <boost/function.hpp>
42 boost::asio::executor_work_guard<boost::asio::io_service::executor_type>
65 for (std::size_t i = 0; i <
pool_size; ++i){
67 [&] () -> boost::asio::io_context::count_type{
82 catch (
const std::exception&) {}
Base class providing core implementation of a thread pool to deal with multi threading tasks.
Definition: ThreadPool.h:28
std::size_t pool_size
Size of thread pool (number of threads)
Definition: ThreadPool.h:47
ThreadPool(std::size_t const _pool_size)
Thread pool constructor.
Definition: ThreadPool.h:60
boost::asio::io_service io_service_
Instance of boost input/output service for asynchronous data processing.
Definition: ThreadPool.h:36
boost::thread_group threads_
Group of threads.
Definition: ThreadPool.h:51
virtual std::size_t getPoolSize() const
Obtain the thread pool size.
Definition: ThreadPool.h:93
boost::asio::executor_work_guard< boost::asio::io_service::executor_type > work_
Instance of work guard to report the io service when it has pending tasks.
Definition: ThreadPool.h:43