未验证 提交 a07b7510 编写于 作者: C chengduo 提交者: GitHub

Merge pull request #8179 from chengduoZH/feature/refine_buffer_receive

Refine buffer receive
......@@ -71,7 +71,7 @@ bool Buffered<T>::Receive(T* item) {
std::unique_lock<std::mutex> 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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册