From a026f52b73b1d9ec80b95346de8671b77effa95c Mon Sep 17 00:00:00 2001 From: chengduo Date: Sun, 28 Jan 2018 03:59:44 +0800 Subject: [PATCH] refine channel (#7910) --- paddle/{operators/detail => framework}/channel.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename paddle/{operators/detail => framework}/channel.h (94%) diff --git a/paddle/operators/detail/channel.h b/paddle/framework/channel.h similarity index 94% rename from paddle/operators/detail/channel.h rename to paddle/framework/channel.h index cbfdf80040..9ba0fc5c55 100644 --- a/paddle/operators/detail/channel.h +++ b/paddle/framework/channel.h @@ -18,8 +18,7 @@ limitations under the License. */ #include namespace paddle { -namespace operators { -namespace detail { +namespace framework { template class Channel { @@ -38,7 +37,7 @@ class Channel { channel_.push_back(std::move(*channel_element)); lock.unlock(); - empty_cond_var_.notify_all(); + empty_cond_var_.notify_one(); } T* Receive() { @@ -75,7 +74,7 @@ class Channel { void NotifyAllSenders(std::unique_lock* lock) { if (IsBounded()) { lock->unlock(); - full_cond_var_.notify_all(); + full_cond_var_.notify_one(); } } @@ -84,6 +83,5 @@ class Channel { bool IsCapacityFull() const { return channel_.size() >= capacity_; } }; -} // namespace detail } // namespace operator } // namespace paddle -- GitLab