From e536ac5528b51d2c1dec76a5bc1c37b9aaeae67f Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sat, 8 Jan 2011 09:32:07 +0100 Subject: [PATCH] Bug fix: we really need to consume all messages in proc::receive! --- process.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/process.cpp b/process.cpp index 338f20d..53cbb59 100644 --- a/process.cpp +++ b/process.cpp @@ -234,7 +234,7 @@ void process::receive(bool wait) message* msg; m_host_t from; - if (may_receive() && comm.recv(msg, from, wait)) { + while (may_receive() && comm.recv(msg, from, wait)) { switch (msg->get_type()) { case message::INFO: { neighbor* n = rev_neigh[from]; @@ -261,6 +261,7 @@ void process::receive(bool wait) break; } delete msg; + wait = false; // only wait on first recv } } -- 2.39.5