- XBT_IN("(%p)",this);
- if (sleep->getState() == simgrid::surf::Action::State::failed)
- state = SIMIX_FAILED;
- else if(sleep->getState() == simgrid::surf::Action::State::done)
- state = SIMIX_SRC_TIMEOUT;
+ if (get_state() == State::FAILED) {
+ issuer->context_->set_wannadie();
+ issuer->exception_ = std::make_exception_ptr(HostFailureException(XBT_THROW_POINT, "Host failed"));
+ } else {
+ xbt_assert(get_state() == State::SRC_TIMEOUT, "Internal error in RawImpl::finish() unexpected synchro state %s",
+ get_state_str());
+ }
+}
+
+void RawImpl::finish()
+{
+ XBT_DEBUG("RawImpl::finish() in state %s", get_state_str());
+ xbt_assert(simcalls_.size() == 1, "Unexpected number of simcalls waiting: %zu", simcalls_.size());
+ smx_simcall_t simcall = simcalls_.front();
+ simcalls_.pop_front();