Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This is the right condition that prevents deadlocks! :)
[simgrid.git] / src / gras / Msg / gras_msg_exchange.c
index bb894e0..ba36513 100644 (file)
@@ -278,7 +278,8 @@ gras_msg_handleall(double period) {
        RETHROW0("Error while waiting for messages: %s");
       xbt_ex_free(e);
     }
-  } while (now - begin < period);
+     /* Epsilon to avoid numerical stability issues were the waited interval is so small that the global clock cannot notice the increment */
+  } while (period - now + begin > 0);
 }
 
 /** @brief Handle an incomming message or timer (or wait up to \a timeOut seconds)