From d4b6ec4c7db7b29089bfff9af242bd20c19d612e Mon Sep 17 00:00:00 2001 From: HanSY Date: Wed, 25 Sep 2024 11:02:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80Enqueue=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: HanSY --- include/thread_pool.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/thread_pool.h b/include/thread_pool.h index 5139a91..b95e7f5 100644 --- a/include/thread_pool.h +++ b/include/thread_pool.h @@ -16,8 +16,6 @@ #ifndef OHOS_RESTOOL_THREAD_POOL_H #define OHOS_RESTOOL_THREAD_POOL_H -#include "no_copy_able.h" - #include #include #include @@ -30,14 +28,14 @@ namespace OHOS { namespace Global { namespace Restool { -class ThreadPool : public NoCopyable { +class ThreadPool{ public: /** * @brief Creates a thread pool with specify thread count * @param threadCount the count of threads to be created */ explicit ThreadPool(const size_t threadCount); - ~ThreadPool() override; + ~ThreadPool(); /** * @brief Start the thread pool @@ -55,7 +53,7 @@ public: * @param args the args of the function */ template - auto Enqueue(F &&f, Args &&...args) -> std::future::type>; + std::future::type> Enqueue(F &&f, Args &&...args); private: void WorkInThread(); @@ -69,7 +67,7 @@ private: }; template -auto ThreadPool::Enqueue(F &&f, Args &&...args) -> std::future::type> +std::future::type> ThreadPool::Enqueue(F &&f, Args &&...args) { using return_type = typename std::result_of::type; using p_task = std::packaged_task;