From 781a02eae803ea7a46dc2cdfc15f967699be920f Mon Sep 17 00:00:00 2001 From: ChunelFeng Date: Sat, 13 Jan 2024 17:54:32 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=9C=A8w?= =?UTF-8?q?indows=E4=B8=8A=EF=BC=8C=E7=BA=BF=E7=A8=8B=E6=B1=A0init?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E5=81=B6=E7=8E=B0=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UtilsCtrl/ThreadPool/UThreadPool.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/UtilsCtrl/ThreadPool/UThreadPool.cpp b/src/UtilsCtrl/ThreadPool/UThreadPool.cpp index 4293b1a..b123bd6 100644 --- a/src/UtilsCtrl/ThreadPool/UThreadPool.cpp +++ b/src/UtilsCtrl/ThreadPool/UThreadPool.cpp @@ -51,12 +51,15 @@ CStatus UThreadPool::init() { for (int i = 0; i < config_.default_thread_size_; i++) { auto ptr = CGRAPH_SAFE_MALLOC_COBJECT(UThreadPrimary); // 创建核心线程数 ptr->setThreadPoolInfo(i, &task_queue_, &primary_threads_, &config_); - status += ptr->init(); // 记录线程和匹配id信息 thread_record_map_[(CSize)std::hash{}(ptr->thread_.get_id())] = i; primary_threads_.emplace_back(ptr); } + + for (auto* pt : primary_threads_) { + status += pt->init(); + } CGRAPH_FUNCTION_CHECK_STATUS /**