if (simcall->issuer_->is_suspended()) {
XBT_DEBUG("Wait! This process is suspended and can't wake up now.");
simcall->issuer_->suspended_ = false;
- simcall->issuer_->suspend(simcall->issuer_);
+ simcall->issuer_->suspend();
} else {
simcall->issuer_->simcall_answer();
}
xbt_assert(exception_ == nullptr, "Gasp! This exception may be lost by subsequent calls.");
suspended_ = false;
- suspend(this);
+ suspend();
}
if (exception_ != nullptr) {
return actor->ciface();
}
-void ActorImpl::suspend(ActorImpl* issuer)
+void ActorImpl::suspend()
{
if (suspended_) {
XBT_DEBUG("Actor '%s' is already suspended", get_cname());
void daemonize();
bool is_suspended() { return suspended_; }
s4u::Actor* restart();
- void suspend(ActorImpl* issuer);
+ void suspend();
void resume();
activity::ActivityImplPtr join(ActorImpl* actor, double timeout);
activity::ActivityImplPtr sleep(double duration);
for (auto& smx_process : process_list_) {
XBT_DEBUG("suspend %s", smx_process.get_cname());
- smx_process.suspend(issuer);
+ smx_process.suspend();
}
XBT_DEBUG("suspend all processes on the VM done done");
auto target = pimpl_;
s4u::Actor::on_suspend(*this);
kernel::actor::simcall_blocking<void>([issuer, target]() {
- target->suspend(issuer);
+ target->suspend();
if (target != issuer) {
/* If we are suspending ourselves, then just do not finish the simcall now */
issuer->simcall_answer();
void suspend()
{
- SIMIX_process_self()->iface()->suspend();
+ kernel::actor::ActorImpl* self = SIMIX_process_self();
+ s4u::Actor::on_suspend(*self->ciface());
+ kernel::actor::simcall_blocking<void>([self] { self->suspend(); });
}
void resume()