X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3721210a272c9593a3bccd52f63178403b5729e3..b9625f82f86db0674e911887addce45dca31b57f:/examples/s4u/actor-yield/s4u-actor-yield.cpp diff --git a/examples/s4u/actor-yield/s4u-actor-yield.cpp b/examples/s4u/actor-yield/s4u-actor-yield.cpp index bd80f70c3e..9ef0d79ec0 100644 --- a/examples/s4u/actor-yield/s4u-actor-yield.cpp +++ b/examples/s4u/actor-yield/s4u-actor-yield.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2017-2020. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -14,13 +14,13 @@ * It can also be used to benchmark our context-switching mechanism. */ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_actor_yield, "Messages specific for this s4u example"); -/* Main function of the Yielder process */ +/* Main function of the Yielder actor */ class yielder { long number_of_yields; public: - explicit yielder(std::vector args) { number_of_yields = std::stod(args[1]); } - void operator()() + explicit yielder(std::vector args) { number_of_yields = std::stol(args[1]); } + void operator()() const { for (int i = 0; i < number_of_yields; i++) simgrid::s4u::this_actor::yield();