16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_THREADING_THREADPOOL_H_ 17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_THREADING_THREADPOOL_H_ 19 #include <condition_variable> 47 ThreadPool(
size_t maxThreads = DEFAULT_MAX_THREAD_POOL_THREADS);
69 void releaseWorker(std::unique_ptr<WorkerThread> workerThread);
93 uint64_t& threadsCreated,
94 uint64_t& threadsObtained,
95 uint64_t& threadsReleasedToPool,
96 uint64_t& threadsReleasedFromPool);
106 std::list<std::unique_ptr<WorkerThread>> m_workerQueue;
109 size_t m_maxPoolThreads;
118 uint64_t m_releasedToPool;
121 uint64_t m_releasedFromPool;
124 std::mutex m_queueMutex;
132 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_THREADING_THREADPOOL_H_ ThreadPool(size_t maxThreads=DEFAULT_MAX_THREAD_POOL_THREADS)
Definition: ThreadPool.h:42
std::unique_ptr< WorkerThread > obtainWorker()
void getStats(uint64_t &threadsCreated, uint64_t &threadsObtained, uint64_t &threadsReleasedToPool, uint64_t &threadsReleasedFromPool)
void setMaxThreads(size_t maxThreads)
static std::shared_ptr< ThreadPool > getDefaultThreadPool()
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
void releaseWorker(std::unique_ptr< WorkerThread > workerThread)
static const size_t DEFAULT_MAX_THREAD_POOL_THREADS
Definition: ThreadPool.h:30