From a08bf76f74cbdd4db4a773a4557b4ad6551ce679 Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Fri, 13 Apr 2018 13:52:39 +0800 Subject: [PATCH] refine name --- paddle/fluid/framework/threadpool.cc | 10 +++++----- paddle/fluid/framework/threadpool.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/paddle/fluid/framework/threadpool.cc b/paddle/fluid/framework/threadpool.cc index 109c2c745c6..f26f212d4d5 100644 --- a/paddle/fluid/framework/threadpool.cc +++ b/paddle/fluid/framework/threadpool.cc @@ -95,15 +95,15 @@ void ThreadPool::TaskLoop() { } } -std::unique_ptr MultiStreamThreadPool::io_threadpool_(nullptr); -std::once_flag MultiStreamThreadPool::io_init_flag_; +std::unique_ptr ThreadPoolIO::io_threadpool_(nullptr); +std::once_flag ThreadPoolIO::io_init_flag_; -ThreadPool* MultiStreamThreadPool::GetInstanceIO() { - std::call_once(io_init_flag_, &MultiStreamThreadPool::InitIO); +ThreadPool* ThreadPoolIO::GetInstanceIO() { + std::call_once(io_init_flag_, &ThreadPoolIO::InitIO); return io_threadpool_.get(); } -void MultiStreamThreadPool::InitIO() { +void ThreadPoolIO::InitIO() { if (io_threadpool_.get() == nullptr) { // TODO(typhoonzero1986): make this configurable io_threadpool_.reset(new ThreadPool(FLAGS_io_threadpool_size)); diff --git a/paddle/fluid/framework/threadpool.h b/paddle/fluid/framework/threadpool.h index 1cc058834c0..94111ee335b 100644 --- a/paddle/fluid/framework/threadpool.h +++ b/paddle/fluid/framework/threadpool.h @@ -135,7 +135,7 @@ class ThreadPool { std::condition_variable completed_; }; -class MultiStreamThreadPool : ThreadPool { +class ThreadPoolIO : ThreadPool { public: static ThreadPool* GetInstanceIO(); static void InitIO(); @@ -156,7 +156,7 @@ std::future Async(Callback callback) { template std::future AsyncIO(Callback callback) { - return MultiStreamThreadPool::GetInstanceIO()->Run(callback); + return ThreadPoolIO::GetInstanceIO()->Run(callback); } } // namespace framework -- GitLab