- if (not MC_is_active() && not MC_record_replay_is_active()) {
- auto element = std::find(execs.begin(), execs.end(), this);
- int rank = element != execs.end() ? static_cast<int>(std::distance(execs.begin(), element)) : -1;
- observer->set_result(rank);
- }
- }
- switch (state_) {
- case State::FAILED:
- simcall->issuer_->context_->set_wannadie();
- if (simcall->issuer_->get_host()->is_on())
- simcall->issuer_->exception_ = std::make_exception_ptr(HostFailureException(XBT_THROW_POINT, "Host failed"));
- /* else, the actor will be killed with no possibility to survive */
- break;
-
- case State::CANCELED:
- simcall->issuer_->exception_ = std::make_exception_ptr(CancelException(XBT_THROW_POINT, "Execution Canceled"));
- break;
-
- case State::TIMEOUT:
- simcall->issuer_->exception_ = std::make_exception_ptr(TimeoutException(XBT_THROW_POINT, "Timeouted"));
- break;
-
- default:
- xbt_assert(state_ == State::DONE, "Internal error in ExecImpl::finish(): unexpected synchro state %s",
- to_c_str(state_));
- }