From b94f24d44f314279cfe7230db37a22e225957e15 Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Mon, 2 Apr 2018 17:33:14 +0800 Subject: [PATCH] Move StartPrefetcher and EndPrefetcher to private --- .../operators/reader/create_double_buffer_reader_op.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/operators/reader/create_double_buffer_reader_op.cc b/paddle/fluid/operators/reader/create_double_buffer_reader_op.cc index 342cd2a5490..f9a8058f2a3 100644 --- a/paddle/fluid/operators/reader/create_double_buffer_reader_op.cc +++ b/paddle/fluid/operators/reader/create_double_buffer_reader_op.cc @@ -66,6 +66,9 @@ class DoubleBufferReader : public framework::DecoratedReader { void ReadNext(std::vector* out) override; void ReInit() override; + ~DoubleBufferReader() { EndPrefetcher(); } + + private: void StartPrefetcher() { channel_ = framework::MakeChannel(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_; -- GitLab