*/
smx_actor_t SIMIX_process_self()
{
- smx_context_t self_context = simgrid::kernel::context::Context::self();
+ simgrid::kernel::context::Context* self_context = simgrid::kernel::context::Context::self();
return (self_context != nullptr) ? self_context->get_actor() : nullptr;
}
XBT_DEBUG("Control returned to me: '%s'", get_cname());
if (context_->iwannadie) {
-
XBT_DEBUG("Actor %s@%s is dead", get_cname(), host_->get_cname());
// throw simgrid::kernel::context::ForcefulKillException(); Does not seem to properly kill the actor
context_->stop();
s4u::Actor* ActorImpl::restart()
{
+ xbt_assert(this != simix_global->maestro_process, "Restarting maestro is not supported");
+
XBT_DEBUG("Restarting actor %s on %s", get_cname(), host_->get_cname());
// retrieve the arguments of the old actor
ProcessArg arg = ProcessArg(host_, this);
// kill the old actor
- (this == simix_global->maestro_process) ? this->exit() : SIMIX_process_self()->kill(this);
+ context::Context::self()->get_actor()->kill(this);
// start the new actor
ActorImplPtr actor =