/** Retrieve the property value (or nullptr if not set) */
const char* getProperty(const char* key);
void setProperty(const char* key, const char* value);
+ Actor* restart();
};
/** @ingroup s4u_api
* \brief Restarts a process from the beginning.
*/
XBT_PUBLIC(msg_process_t) MSG_process_restart(msg_process_t process) {
- return simgrid::simix::kernelImmediate(
- [process]() { return process->getImpl()->restart(process->getImpl())->ciface(); });
+ return process->restart();
}
/** @ingroup m_process_management
});
}
+Actor* Actor::restart()
+{
+ return simgrid::simix::kernelImmediate([this]() { return pimpl_->restart(); });
+}
+
// ***** this_actor *****
namespace this_actor {
}
}
-ActorImpl* ActorImpl::restart(ActorImpl* issuer)
+simgrid::s4u::Actor* ActorImpl::restart()
{
XBT_DEBUG("Restarting process %s on %s", cname(), host->getCname());
arg.auto_restart = auto_restart;
// kill the old process
- SIMIX_process_kill(this, issuer);
+ SIMIX_process_kill(this, this);
// start the new process
ActorImpl* actor = simix_global->create_process_function(arg.name.c_str(), std::move(arg.code), arg.data, arg.host,
if (arg.auto_restart)
actor->auto_restart = arg.auto_restart;
- return actor;
+ return actor->ciface();
}
smx_activity_t ActorImpl::suspend(ActorImpl* issuer)
void daemonize();
bool isDaemon() { return daemon; } /** Whether this actor has been daemonized */
bool isSuspended() { return suspended; }
- ActorImpl* restart(ActorImpl* issuer);
+ simgrid::s4u::Actor* restart();
smx_activity_t suspend(ActorImpl* issuer);
void resume();
smx_activity_t sleep(double duration);