Represents a server-side thread pool. More...
#include <ThreadPool.hpp>
Inherits enable_shared_from_this< ThreadPool >.
Public Member Functions | |
void | setThreadMinCount (std::size_t threadMinCount) |
Sets the minimum number of threads in the thread pool. More... | |
std::size_t | getThreadMinCount () const |
Returns the minimum number of threads in the thread pool. More... | |
void | setThreadMaxCount (std::size_t threadMaxCount) |
Sets the maximum number of threads in the thread pool. More... | |
std::size_t | getThreadMaxCount () const |
Returns the maximum number of threads in the thread pool. More... | |
void | setThreadIdleTimeoutMs (std::uint32_t threadIdleTimeoutMs) |
std::uint32_t | getThreadIdleTimeoutMs () const |
Returns the thread idle timeout value, in milliseconds. More... | |
void | setReserveLastThread (bool reserveLastThread) |
void | setThreadName (const std::string &threadName) |
Sets the thread name of the thread pool threads, as visible in a debugger. More... | |
std::string | getThreadName () const |
Returns the thread name of the thread pool threads. More... | |
void | addThreadInitFunctor (ThreadInitFunctor threadInitFunctor) |
Sets a function which will be called once by each thread when it starts. More... | |
void | addThreadDeinitFunctor (ThreadDeinitFunctor threadDeinitFunctor) |
Sets a function which will be called once by each thread when it is about to stop. More... | |
Represents a server-side thread pool.
void RCF::ThreadPool::setThreadMinCount | ( | std::size_t | threadMinCount | ) |
Sets the minimum number of threads in the thread pool.
std::size_t RCF::ThreadPool::getThreadMinCount | ( | ) | const |
Returns the minimum number of threads in the thread pool.
void RCF::ThreadPool::setThreadMaxCount | ( | std::size_t | threadMaxCount | ) |
Sets the maximum number of threads in the thread pool.
std::size_t RCF::ThreadPool::getThreadMaxCount | ( | ) | const |
Returns the maximum number of threads in the thread pool.
void RCF::ThreadPool::setThreadIdleTimeoutMs | ( | std::uint32_t | threadIdleTimeoutMs | ) |
Sets the thread idle timeout value, in milliseconds. After a thread has been idle for this time, it will be shut down, unless the thread count is already at the minimum value for the thread pool.
std::uint32_t RCF::ThreadPool::getThreadIdleTimeoutMs | ( | ) | const |
Returns the thread idle timeout value, in milliseconds.
void RCF::ThreadPool::setReserveLastThread | ( | bool | reserveLastThread | ) |
If this setting is true, clients will receive an error message right away, if all threads in the thread pool are busy. Otherwise, the client will wait for a thread in the thread pool to become free.
void RCF::ThreadPool::setThreadName | ( | const std::string & | threadName | ) |
Sets the thread name of the thread pool threads, as visible in a debugger.
std::string RCF::ThreadPool::getThreadName | ( | ) | const |
Returns the thread name of the thread pool threads.
void RCF::ThreadPool::addThreadInitFunctor | ( | ThreadInitFunctor | threadInitFunctor | ) |
Sets a function which will be called once by each thread when it starts.
void RCF::ThreadPool::addThreadDeinitFunctor | ( | ThreadDeinitFunctor | threadDeinitFunctor | ) |
Sets a function which will be called once by each thread when it is about to stop.