- kernel::actor::ActorImpl* process = kernel::actor::ActorImpl::by_pid(message->aid_);
- xbt_assert(process != nullptr, "Invalid pid %ld", message->aid_);
- process->simcall_handle(message->times_considered_);
+ kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(message->aid_);
+ xbt_assert(actor != nullptr, "Invalid pid %ld", message->aid_);
+ simgrid::kernel::actor::SimcallObserver* observer = nullptr;
+ if (actor->simcall_.observer_ != nullptr) {
+ observer = actor->simcall_.observer_->clone();
+ actor->observer_stack_.push_back(observer);
+ }
+ // Finish the RPC from the server: we need to return a pointer to the observer, saved in a stable storage
+ s_mc_message_simcall_execute_answer_t answer{MessageType::SIMCALL_EXECUTE_ANSWER, observer};
+ XBT_DEBUG("send SIMCALL_EXECUTE_ANSWER(%p)", observer);
+ xbt_assert(channel_.send(answer) == 0, "Could not send response");
+
+ // The client may send some messages to the server while processing the transition
+ actor->simcall_handle(message->times_considered_);
+
+ // Say the server that the transition is over and that it should proceed