7 #ifndef HTTP_THREAD_POOL_H
8 #define HTTP_THREAD_POOL_H
13 #include <boost/shared_ptr.hpp>
15 #include <condition_variable>
44 bool defer_start =
false);
128 void setState(
State state);
140 bool validateStateChange(
State state)
const;
203 std::condition_variable thread_cv_;
207 std::condition_variable main_cv_;
220 std::list<boost::shared_ptr<std::thread> > threads_;
HttpThreadPool(asiolink::IOServicePtr io_service, size_t pool_size, bool defer_start=false)
Constructor.
Pool is populated with running threads.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
uint16_t getPoolSize() const
Fetches the maximum size of the thread pool.
bool isPaused()
Check if the thread pool is paused.
void pause()
Transitions the pool from RUNNING to PAUSED.
bool isRunning()
Check if the thread pool is running.
uint16_t getThreadCount() const
Fetches the number of threads in the pool.
void run()
Transitions the pool from STOPPED or PAUSED to RUNNING.
bool isStopped()
Check if the thread pool is stopped.
Defines the logger used by the top-level component of kea-dhcp-ddns.
~HttpThreadPool()
Destructor.
Implements a pausable pool of IOService driven threads.
boost::shared_ptr< HttpThreadPool > HttpThreadPoolPtr
Defines a pointer to a thread pool.
State
Describes the possible operational state of the thread pool.
asiolink::IOServicePtr getIOService() const
Fetches the IOService that drives the pool.
void stop()
Transitions the pool from RUNNING or PAUSED to STOPPED.