提交 b94f24d4 编写于 作者: F fengjiayi

Move StartPrefetcher and EndPrefetcher to private

上级 597c845c
......@@ -66,6 +66,9 @@ class DoubleBufferReader : public framework::DecoratedReader {
void ReadNext(std::vector<framework::LoDTensor>* out) override;
void ReInit() override;
~DoubleBufferReader() { EndPrefetcher(); }
private:
void StartPrefetcher() {
channel_ = framework::MakeChannel<Item>(kChannelSize);
prefetcher_ = std::thread([this] { PrefetchThreadFunc(); });
......@@ -80,9 +83,6 @@ class DoubleBufferReader : public framework::DecoratedReader {
channel_ = nullptr;
}
~DoubleBufferReader() { EndPrefetcher(); }
private:
void PrefetchThreadFunc();
std::thread prefetcher_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册