X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6366f4c5942aaaf7264d96aac038a4a7c9983195..e10bd21dc31e83417de6984b8790e7a147aaa7b5:/docs/source/tuto_s4u/master-workers-lab3.cpp diff --git a/docs/source/tuto_s4u/master-workers-lab3.cpp b/docs/source/tuto_s4u/master-workers-lab3.cpp index f31f381c69..6d657826fd 100644 --- a/docs/source/tuto_s4u/master-workers-lab3.cpp +++ b/docs/source/tuto_s4u/master-workers-lab3.cpp @@ -21,10 +21,9 @@ static void worker() const std::string mailbox_name = std::string("worker-") + std::to_string(simgrid::s4u::this_actor::get_pid()); simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::by_name(mailbox_name); - double compute_cost; while (true) { // Master forcefully kills the workers by the end of the simulation double* msg = static_cast(mailbox->get()); - compute_cost = *msg; + double compute_cost = *msg; delete msg; simgrid::s4u::this_actor::execute(compute_cost);