From 9d9e03c758a86858eec6a4d133a3c21825ee47ea Mon Sep 17 00:00:00 2001 From: fasiondog Date: Mon, 12 Aug 2024 17:37:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=BB=84=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E9=9B=86=E4=B8=AD=E4=BB=BB=E5=8A=A1=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hikyuu_cpp/hikyuu/global/GlobalTaskGroup.cpp | 6 +++--- hikyuu_cpp/hikyuu/global/GlobalTaskGroup.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hikyuu_cpp/hikyuu/global/GlobalTaskGroup.cpp b/hikyuu_cpp/hikyuu/global/GlobalTaskGroup.cpp index c3018f9c..c0b18e25 100644 --- a/hikyuu_cpp/hikyuu/global/GlobalTaskGroup.cpp +++ b/hikyuu_cpp/hikyuu/global/GlobalTaskGroup.cpp @@ -13,9 +13,9 @@ namespace hku { -static StealThreadPool* g_threadPool; +static ThreadPool* g_threadPool; -StealThreadPool* getGlobalTaskGroup() { +ThreadPool* getGlobalTaskGroup() { static std::once_flag oc; std::call_once(oc, [&]() { auto cpu_num = std::thread::hardware_concurrency(); @@ -24,7 +24,7 @@ StealThreadPool* getGlobalTaskGroup() { } else if (cpu_num > 1) { cpu_num--; } - g_threadPool = new StealThreadPool(cpu_num); + g_threadPool = new ThreadPool(cpu_num); }); return g_threadPool; } diff --git a/hikyuu_cpp/hikyuu/global/GlobalTaskGroup.h b/hikyuu_cpp/hikyuu/global/GlobalTaskGroup.h index 69d345ba..1eb5840d 100644 --- a/hikyuu_cpp/hikyuu/global/GlobalTaskGroup.h +++ b/hikyuu_cpp/hikyuu/global/GlobalTaskGroup.h @@ -11,7 +11,7 @@ #ifndef HKU_GLOBAL_TASK_GROUP #define HKU_GLOBAL_TASK_GROUP -#include "../utilities/thread/StealThreadPool.h" +#include "../utilities/thread/thread.h" namespace hku { @@ -19,7 +19,7 @@ namespace hku { * 获取全局线程池任务组 * @note 请使用 future 获取任务返回 */ -StealThreadPool* getGlobalTaskGroup(); +ThreadPool* getGlobalTaskGroup(); template using task_handle = std::future;