Browse Source

V0.4.5
1、修改了ThreadPool的默认参数,不会一直出现退线程的日志了

Apple 4 months ago
parent
commit
1ae31fd943
1 changed files with 4 additions and 3 deletions
  1. 4 3
      common/ThreadPool/ThreadPool.cpp

+ 4 - 3
common/ThreadPool/ThreadPool.cpp

@@ -18,10 +18,11 @@ ThreadPool::ThreadPool() :
     /* 初始化变量 */
     // m_threadMaxNum = std::thread::hardware_concurrency();   /* 根据CPU核心数规定线程数目 */
     m_threadMaxNum = 256;
-    m_threadMiniNum = 3;
+    m_threadMiniNum = 2;
     m_threadAddNum = 2;
-    m_threadMiniIdle = 2;
+    m_threadMiniIdle = 1;
     m_threadMaxIdle = 4;
+
     m_threadRunNum = 0;
     m_threadLiveNum = 0;
     m_threadExitNum = 0;
@@ -52,7 +53,7 @@ ThreadPool::~ThreadPool()
     {
         /* 管理线程自己退出了,所以要手动清空容器 */
         clearThread();
-        std::this_thread::sleep_for(std::chrono::milliseconds(100));
+        std::this_thread::sleep_for(std::chrono::microseconds(100));
     }
 
     FMTLOG_INFO("回收管理线程...");