提交 a08bf76f 编写于 作者: T typhoonzero

refine name

上级 26cfc634
...@@ -95,15 +95,15 @@ void ThreadPool::TaskLoop() { ...@@ -95,15 +95,15 @@ void ThreadPool::TaskLoop() {
} }
} }
std::unique_ptr<ThreadPool> MultiStreamThreadPool::io_threadpool_(nullptr); std::unique_ptr<ThreadPool> ThreadPoolIO::io_threadpool_(nullptr);
std::once_flag MultiStreamThreadPool::io_init_flag_; std::once_flag ThreadPoolIO::io_init_flag_;
ThreadPool* MultiStreamThreadPool::GetInstanceIO() { ThreadPool* ThreadPoolIO::GetInstanceIO() {
std::call_once(io_init_flag_, &MultiStreamThreadPool::InitIO); std::call_once(io_init_flag_, &ThreadPoolIO::InitIO);
return io_threadpool_.get(); return io_threadpool_.get();
} }
void MultiStreamThreadPool::InitIO() { void ThreadPoolIO::InitIO() {
if (io_threadpool_.get() == nullptr) { if (io_threadpool_.get() == nullptr) {
// TODO(typhoonzero1986): make this configurable // TODO(typhoonzero1986): make this configurable
io_threadpool_.reset(new ThreadPool(FLAGS_io_threadpool_size)); io_threadpool_.reset(new ThreadPool(FLAGS_io_threadpool_size));
......
...@@ -135,7 +135,7 @@ class ThreadPool { ...@@ -135,7 +135,7 @@ class ThreadPool {
std::condition_variable completed_; std::condition_variable completed_;
}; };
class MultiStreamThreadPool : ThreadPool { class ThreadPoolIO : ThreadPool {
public: public:
static ThreadPool* GetInstanceIO(); static ThreadPool* GetInstanceIO();
static void InitIO(); static void InitIO();
...@@ -156,7 +156,7 @@ std::future<void> Async(Callback callback) { ...@@ -156,7 +156,7 @@ std::future<void> Async(Callback callback) {
template <typename Callback> template <typename Callback>
std::future<void> AsyncIO(Callback callback) { std::future<void> AsyncIO(Callback callback) {
return MultiStreamThreadPool::GetInstanceIO()->Run(callback); return ThreadPoolIO::GetInstanceIO()->Run(callback);
} }
} // namespace framework } // namespace framework
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册