From 70324911e701829eb1a5ef484ec26920b6578d96 Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Tue, 6 Feb 2018 12:52:10 +0800 Subject: [PATCH] refine buffer receive --- paddle/framework/details/buffered_channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/framework/details/buffered_channel.h b/paddle/framework/details/buffered_channel.h index 7ac234b8d..b9761eab9 100644 --- a/paddle/framework/details/buffered_channel.h +++ b/paddle/framework/details/buffered_channel.h @@ -71,7 +71,7 @@ bool Buffered::Receive(T* item) { std::unique_lock lock(mu_); empty_cond_var_.wait(lock, [this]() { return !channel_.empty() || closed_; }); bool ret = false; - if (!closed_) { + if (!channel_.empty()) { *item = std::move(channel_.front()); channel_.pop_front(); full_cond_var_.notify_one(); -- GitLab