Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sometimes, the time to wait is soo small that the increment does not change the globa...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 16 May 2008 16:08:54 +0000 (16:08 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 16 May 2008 16:08:54 +0000 (16:08 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5436 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/gras/Msg/gras_msg_exchange.c

index bb894e0..0cafee7 100644 (file)
@@ -270,6 +270,7 @@ gras_msg_handleall(double period) {
 
   do {
     now=gras_os_time();
+          
     TRY{
       if (period - now + begin > 0)
        gras_msg_handle(period - now + begin);
@@ -278,7 +279,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 (now - begin < period - 0.000001);
 }
 
 /** @brief Handle an incomming message or timer (or wait up to \a timeOut seconds)