]> AND Private Git Repository - loba.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Bug fix: we really need to consume all messages in proc::receive!
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Sat, 8 Jan 2011 08:32:07 +0000 (09:32 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Sat, 8 Jan 2011 08:32:07 +0000 (09:32 +0100)
process.cpp

index 338f20de49438d0e2f62708d529df4ecdafcbe39..53cbb59c7434da4a84beb5d2971e8c98ea7ae910 100644 (file)
@@ -234,7 +234,7 @@ void process::receive(bool wait)
     message* msg;
     m_host_t from;
 
     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];
         switch (msg->get_type()) {
         case message::INFO: {
             neighbor* n = rev_neigh[from];
@@ -261,6 +261,7 @@ void process::receive(bool wait)
             break;
         }
         delete msg;
             break;
         }
         delete msg;
+        wait = false;           // only wait on first recv
     }
 }
 
     }
 }