From 9401366e8e49b634259bfab97e9f7021cfe4c11d Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Wed, 8 Apr 2020 23:19:17 +0200 Subject: [PATCH] Set wakeupSelectNeeded=true while poll() is running --- src/net.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index a9b43f1175..9a49b275f5 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1448,7 +1448,12 @@ void CConnman::SocketEvents(std::set &recv_set, std::set &send_s vpollfds.push_back(std::move(it.second)); } - if (poll(vpollfds.data(), vpollfds.size(), SELECT_TIMEOUT_MILLISECONDS) < 0) return; + wakeupSelectNeeded = true; + int r = poll(vpollfds.data(), vpollfds.size(), SELECT_TIMEOUT_MILLISECONDS); + wakeupSelectNeeded = false; + if (r < 0) { + return; + } if (interruptNet) return;