From d19d875fd0b7da4e10227ee00bc2035b68f60f47 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 16 Aug 2015 22:00:52 +0200 Subject: [PATCH] Have the s4u::Actor::execute() actually wait for the completion of the execution --- include/simgrid/s4u/actor.hpp | 2 +- src/s4u/s4u_actor.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index 4476f5ef45..6b9c5245f0 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -81,7 +81,7 @@ public: void sleep(double duration); /** Block the actor, computing the given amount of flops */ - void execute(double flop); + e_smx_state_t execute(double flop); /** Block the actor until it gets a message from the given mailbox */ void *recv(Mailbox &chan); diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index 04544a099e..64d429e25b 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -78,8 +78,9 @@ void s4u::Actor::sleep(double duration) { simcall_process_sleep(duration); } -void s4u::Actor::execute(double flops) { - simcall_process_execute(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/); +e_smx_state_t s4u::Actor::execute(double flops) { + smx_synchro_t s = simcall_process_execute(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/); + return simcall_process_execution_wait(s); } void *s4u::Actor::recv(Mailbox &chan) { -- 2.20.1