Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[s4u]fix s4u::Comm::wait_any_for bugs when the timeout is below the current clock
authoradfaure <adrien.faure2@gmail.com>
Wed, 7 Sep 2016 15:23:54 +0000 (17:23 +0200)
committeradfaure <adrien.faure2@gmail.com>
Wed, 7 Sep 2016 15:23:54 +0000 (17:23 +0200)
src/simix/smx_network.cpp

index e25d531..0edf57d 100644 (file)
@@ -497,7 +497,7 @@ void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t synchros, d
   if (timeout < 0.0){
     simcall->timer = NULL;
   } else {
-    simcall->timer = SIMIX_timer_set(timeout, [simcall]() {
+    simcall->timer = SIMIX_timer_set(SIMIX_get_clock() + timeout, [simcall]() {
       SIMIX_waitany_remove_simcall_from_actions(simcall);
       simcall_comm_waitany__set__result(simcall, -1);
       SIMIX_simcall_answer(simcall);