1 /**********************************************************************/
2 /* File generated by src/simix/simcalls.py from src/simix/simcalls.in */
4 /* DO NOT EVER CHANGE THIS FILE */
6 /* change simcalls specification in src/simix/simcalls.in */
7 /* Copyright (c) 2014-2022. The SimGrid Team. All rights reserved. */
8 /**********************************************************************/
11 * Note that the name comes from http://en.wikipedia.org/wiki/Popping
12 * Indeed, the control flow is doing a strange dance in there.
14 * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
17 #include "src/kernel/EngineImpl.hpp"
18 #include "src/kernel/actor/ActorImpl.hpp"
19 #include "src/mc/mc_forward.hpp"
22 #include <simgrid/simix.hpp>
24 /** @cond */ // Please Doxygen, don't look at this
26 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
28 using simgrid::simix::Simcall;
30 template<class R, class... T>
31 inline static R simcall(Simcall call, T const&... t)
33 auto self = simgrid::kernel::actor::ActorImpl::self();
34 simgrid::simix::marshal(&self->simcall_, call, t...);
35 if (not simgrid::kernel::EngineImpl::get_instance()->is_maestro(self)) {
36 XBT_DEBUG("Yield process '%s' on simcall %s", self->get_cname(), SIMIX_simcall_name(self->simcall_));
39 self->simcall_handle(0);
41 return simgrid::simix::unmarshal<R>(self->simcall_.result_);
44 inline static void simcall_BODY_run_kernel(std::function<void()> const* code)
46 if (false) /* Go to that function to follow the code flow through the simcall barrier */
47 SIMIX_run_kernel(code);
48 return simcall<void, std::function<void()> const*>(Simcall::RUN_KERNEL, code);
51 inline static void simcall_BODY_run_blocking(std::function<void()> const* code)
53 if (false) /* Go to that function to follow the code flow through the simcall barrier */
54 SIMIX_run_blocking(code);
55 return simcall<void, std::function<void()> const*>(Simcall::RUN_BLOCKING, code);