From 83772e65065b2590a73c78b0c4ee8b87133f87be Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Thu, 28 Dec 2023 15:10:26 +0800 Subject: [PATCH] fix can't find to_string --- src/ulib/system/thread_pool.cpp | 1 - src/ulib/system/thread_pool.h | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ulib/system/thread_pool.cpp b/src/ulib/system/thread_pool.cpp index 49a0864..d40d8a3 100644 --- a/src/ulib/system/thread_pool.cpp +++ b/src/ulib/system/thread_pool.cpp @@ -1,5 +1,4 @@ #include "thread_pool.h" -#include namespace ulib { ThreadPool::ThreadPool(int max_thread_num, diff --git a/src/ulib/system/thread_pool.h b/src/ulib/system/thread_pool.h index 8431cc6..a5a03ee 100644 --- a/src/ulib/system/thread_pool.h +++ b/src/ulib/system/thread_pool.h @@ -2,6 +2,7 @@ #define ULIB_SRC_ULIB_SYSTEM_THREAD_POOL_H_ #include "thread.h" +#include #include "ulib/log/log.h" #include "ulib/concorrency/condition_variable.h" #include "ulib/concorrency/mutex.h" @@ -39,7 +40,8 @@ public: tasks_.emplace([task]() { (*task)(); }); if (tasks_.size() > idle_thread_num_ && workers_.size() < max_thread_num_) { - AddThread(thread_pool_name_ + std::to_string(workers_.size())); + AddThread(thread_pool_name_ + + fmt::format("{}", workers_.size())); } if (tasks_.size() > 1) { tasks_cond_.NotifyAll();