fix: the receiver of channel will hang after disconnect

This commit is contained in:
木头云 2023-05-14 14:11:54 +08:00 committed by GitHub
parent 2a2b626210
commit 6111722534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -533,7 +533,7 @@ static ipc::buff_t recv(ipc::handle_t h, std::uint64_t tm) {
auto& rc = info_of(h)->recv_cache(); auto& rc = info_of(h)->recv_cache();
for (;;) { for (;;) {
// pop a new message // pop a new message
typename queue_t::value_t msg; typename queue_t::value_t msg {};
if (!wait_for(info_of(h)->rd_waiter_, [que, &msg] { if (!wait_for(info_of(h)->rd_waiter_, [que, &msg] {
return !que->pop(msg); return !que->pop(msg);
}, tm)) { }, tm)) {