MCPcopy Create free account
hub / github.com/ChunelFeng/CThreadPool / UThreadPool

Method UThreadPool

src/UtilsCtrl/ThreadPool/UThreadPool.cpp:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "UThreadPool.h"
10
11CGRAPH_NAMESPACE_BEGIN
12
13UThreadPool::UThreadPool(CBool autoInit, const UThreadPoolConfig& config) noexcept {
14 cur_index_ = 0;
15 is_init_ = false;
16 input_task_num_ = 0;
17 this->setConfig(config); // setConfig 函数,用在 is_init_ 设定之后
18 is_monitor_ = config_.monitor_enable_; /** 根据参数设定,决定是否开启监控线程。默认开启 */
19 /**
20 * CGraph 本身支持跨平台运行
21 * 如果在windows平台上,通过Visual Studio(2017版本或以下) 版本,将 UThreadPool 类封装程.dll文件时,遇到无法启动的问题
22 * 请参考此链接:https://github.com/ChunelFeng/CGraph/issues/17
23 */
24 monitor_thread_ = std::move(std::thread(&UThreadPool::monitor, this));
25 if (autoInit) {
26 this->init();
27 }
28}
29
30
31UThreadPool::~UThreadPool() {

Callers

nothing calls this directly

Calls 2

setConfigMethod · 0.95
initMethod · 0.95

Tested by

no test coverage detected