From: Arnaud Giersch Date: Sat, 8 Jan 2011 08:32:07 +0000 (+0100) Subject: Bug fix: we really need to consume all messages in proc::receive! X-Git-Tag: v0.1~191 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/e536ac5528b51d2c1dec76a5bc1c37b9aaeae67f?hp=--cc Bug fix: we really need to consume all messages in proc::receive! --- e536ac5528b51d2c1dec76a5bc1c37b9aaeae67f 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 } }