void Actor::suspend()
{
+ auto issuer = SIMIX_process_self();
+ auto target = pimpl_;
s4u::Actor::on_suspend(*this);
- simcall_process_suspend(pimpl_);
+ simix::simcall_blocking([issuer, target]() {
+ target->suspend(issuer);
+ if (target != issuer) {
+ /* If we are suspending ourselves, then just do not finish the simcall now */
+ issuer->simcall_answer();
+ }
+ });
}
void Actor::resume()
void suspend()
{
- kernel::actor::ActorImpl* actor = SIMIX_process_self();
- Actor::on_suspend(*actor->ciface());
-
- simcall_process_suspend(actor);
+ SIMIX_process_self()->iface()->suspend();
}
void resume()