提交 a026f52b 编写于 作者: C chengduo 提交者: Yi Wang

refine channel (#7910)

上级 8a6a339e
......@@ -18,8 +18,7 @@ limitations under the License. */
#include <queue>
namespace paddle {
namespace operators {
namespace detail {
namespace framework {
template <typename T>
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<std::mutex>* 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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册