| 29 | |
| 30 | |
| 31 | UThreadPool::~UThreadPool() { |
| 32 | is_monitor_ = false; // 在析构的时候,才释放监控线程。先释放监控线程,再释放其他的线程 |
| 33 | if (monitor_thread_.joinable()) { |
| 34 | monitor_thread_.join(); |
| 35 | } |
| 36 | |
| 37 | destroy(); |
| 38 | } |
| 39 | |
| 40 | |
| 41 | CStatus UThreadPool::setConfig(const UThreadPoolConfig &config) { |