From: Arnaud Giersch Date: Tue, 16 Mar 2021 13:49:22 +0000 (+0100) Subject: Cosmetics: use a meaningful name for parameter. X-Git-Tag: v3.27~113 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c70856d8b8a08904f494cc2b6418f89d5d074090 Cosmetics: use a meaningful name for parameter. --- diff --git a/include/simgrid/simix.hpp b/include/simgrid/simix.hpp index 22e84df453..7345acf48c 100644 --- a/include/simgrid/simix.hpp +++ b/include/simgrid/simix.hpp @@ -17,8 +17,8 @@ #include #include -XBT_PUBLIC void simcall_run_kernel(std::function const& code, simgrid::mc::SimcallObserver* t); -XBT_PUBLIC void simcall_run_blocking(std::function const& code, simgrid::mc::SimcallObserver* t); +XBT_PUBLIC void simcall_run_kernel(std::function const& code, simgrid::mc::SimcallObserver* observer); +XBT_PUBLIC void simcall_run_blocking(std::function const& code, simgrid::mc::SimcallObserver* observer); namespace simgrid { namespace kernel { @@ -43,7 +43,7 @@ namespace actor { * you may need to wait for that mutex to be unlocked by its current owner. * Potentially blocking simcall must be issued using simcall_blocking(), right below in this file. */ -template typename std::result_of_t simcall(F&& code, mc::SimcallObserver* t = nullptr) +template typename std::result_of_t simcall(F&& code, mc::SimcallObserver* observer = nullptr) { // If we are in the maestro, we take the fast path and execute the // code directly without simcall marshalling/unmarshalling/dispatch: @@ -55,7 +55,7 @@ template typename std::result_of_t simcall(F&& code, mc::SimcallO // conveniently handles the success/failure value for us. using R = typename std::result_of_t; simgrid::xbt::Result result; - simcall_run_kernel([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward(code)); }, t); + simcall_run_kernel([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward(code)); }, observer); return result.get(); } @@ -76,7 +76,7 @@ template typename std::result_of_t simcall(F&& code, mc::SimcallO * * If your code never calls actor->simcall_answer() itself, the actor will never return from its simcall. */ -template R simcall_blocking(F&& code, mc::SimcallObserver* t = nullptr) +template R simcall_blocking(F&& code, mc::SimcallObserver* observer = nullptr) { xbt_assert(not SIMIX_is_maestro(), "Cannot execute blocking call in kernel mode"); @@ -84,7 +84,7 @@ template R simcall_blocking(F&& code, mc::SimcallObserver* t // executes it for us and reports the result. We use a std::future which // conveniently handles the success/failure value for us. simgrid::xbt::Result result; - simcall_run_blocking([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward(code)); }, t); + simcall_run_blocking([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward(code)); }, observer); return result.get(); } } // namespace actor diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 0d9179562d..d9ea4dcb5e 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -352,16 +352,16 @@ bool simcall_io_test(const simgrid::kernel::activity::ActivityImplPtr& io) // XB return simgrid::kernel::actor::simcall([io] { return io->test(); }); } -void simcall_run_kernel(std::function const& code, simgrid::mc::SimcallObserver* t) +void simcall_run_kernel(std::function const& code, simgrid::mc::SimcallObserver* observer) { - simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = t; + simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = observer; simcall_BODY_run_kernel(&code); simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = nullptr; } -void simcall_run_blocking(std::function const& code, simgrid::mc::SimcallObserver* t) +void simcall_run_blocking(std::function const& code, simgrid::mc::SimcallObserver* observer) { - simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = t; + simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = observer; simcall_BODY_run_blocking(&code); simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = nullptr; }