- #
- # popping_bodies.cpp
- #
- fd = header('popping_bodies.cpp')
- fd.write('#include "smx_private.hpp"\n')
- fd.write('#include "src/mc/mc_forward.hpp"\n')
- fd.write('#include "xbt/ex.h"\n')
- fd.write('#include <functional>\n')
- fd.write('#include <simgrid/simix.hpp>\n')
- fd.write('#include <xbt/log.h>\n')
-
- fd.write("/** @cond */ // Please Doxygen, don't look at this\n")
- fd.write('''
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
-
-template<class R, class... T>
-inline static R simcall(e_smx_simcall_t call, T const&... t)
-{
- smx_actor_t self = SIMIX_process_self();
- simgrid::simix::marshal(&self->simcall_, call, t...);
- if (self != simix_global->maestro_) {
- XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->get_cname(), SIMIX_simcall_name(self->simcall_.call_),
- (int)self->simcall_.call_);
- self->yield();
- } else {
- self->simcall_handle(0);
- }
- return simgrid::simix::unmarshal<R>(self->simcall_.result_);
-}
-''')
- handle(fd, Simcall.body, simcalls, simcalls_dict)
- fd.write("/** @endcond */\n")
- fd.close()