- worker_context_ = static_cast<SwappedContext*>(self());
- // Switch my soul and the actor's one
- Context::set_current(this);
- worker_context_->swap_into(this);
- // No body runs that soul anymore at this point, but it is stored in a safe place.
- // When the executed actor will do a blocking action, ActorImpl::yield() will call suspend(), below.
- } else { // sequential execution
- SwappedContext* old = static_cast<SwappedContext*>(self());
- Context::set_current(this);
- old->swap_into(this);