提交 a08bf76f 编写于 作者: T typhoonzero

refine name

上级 26cfc634
......@@ -95,15 +95,15 @@ void ThreadPool::TaskLoop() {
}
}
std::unique_ptr<ThreadPool> MultiStreamThreadPool::io_threadpool_(nullptr);
std::once_flag MultiStreamThreadPool::io_init_flag_;
std::unique_ptr<ThreadPool> 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));
......
......@@ -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<void> Async(Callback callback) {
template <typename Callback>
std::future<void> AsyncIO(Callback callback) {
return MultiStreamThreadPool::GetInstanceIO()->Run(callback);
return ThreadPoolIO::GetInstanceIO()->Run(callback);
}
} // namespace framework
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册