| 21 | |
| 22 | |
| 23 | UThreadPool::~UThreadPool() { |
| 24 | this->config_.monitor_enable_ = false; // 在析构的时候,才释放监控线程。先释放监控线程,再释放其他的线程 |
| 25 | if (monitor_thread_.joinable()) { |
| 26 | monitor_thread_.join(); |
| 27 | } |
| 28 | |
| 29 | destroy(); |
| 30 | } |
| 31 | |
| 32 | |
| 33 | CStatus UThreadPool::setConfig(const UThreadPoolConfig &config) { |