void simgrid::kernel::activity::SleepImpl::suspend()
{
- surf_sleep->suspend();
+ surf_action_->suspend();
}
void simgrid::kernel::activity::SleepImpl::resume()
{
- surf_sleep->resume();
+ surf_action_->resume();
}
void simgrid::kernel::activity::SleepImpl::post()
std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed")));
}
- switch (surf_sleep->get_state()) {
+ switch (surf_action_->get_state()) {
case simgrid::kernel::resource::Action::State::FAILED:
simcall->issuer->context_->iwannadie = true;
result = SIMIX_FAILED;
simgrid::kernel::activity::RawImpl::~RawImpl()
{
- sleep->unref();
+ surf_action_->unref();
}
void simgrid::kernel::activity::RawImpl::suspend()
{
void simgrid::kernel::activity::RawImpl::post()
{
XBT_IN("(%p)",this);
- if (sleep->get_state() == simgrid::kernel::resource::Action::State::FAILED)
+ if (surf_action_->get_state() == simgrid::kernel::resource::Action::State::FAILED)
state_ = SIMIX_FAILED;
- else if (sleep->get_state() == simgrid::kernel::resource::Action::State::FINISHED)
+ else if (surf_action_->get_state() == simgrid::kernel::resource::Action::State::FINISHED)
state_ = SIMIX_SRC_TIMEOUT;
SIMIX_synchro_finish(this);
simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
synchro->host = host_;
- synchro->surf_sleep = host_->pimpl_cpu->sleep(duration);
- synchro->surf_sleep->set_data(synchro);
+ synchro->surf_action_ = host_->pimpl_cpu->sleep(duration);
+ synchro->surf_action_->set_data(synchro);
XBT_DEBUG("Create sleep synchronization %p", synchro);
return synchro;
if (i != actor->waiting_synchro->simcalls_.end())
actor->waiting_synchro->simcalls_.remove(&actor->simcall);
} else if (sleep != nullptr) {
- if (sleep->surf_sleep)
- sleep->surf_sleep->cancel();
+ if (sleep->surf_action_)
+ sleep->surf_action_->cancel();
sleep->post();
} else if (raw != nullptr) {
SIMIX_synchro_stop_waiting(actor, &actor->simcall);
SIMIX_process_on_exit(process,
[](int, void* arg) {
auto sleep = static_cast<simgrid::kernel::activity::SleepImpl*>(arg);
- if (sleep->surf_sleep)
- sleep->surf_sleep->finish(simgrid::kernel::resource::Action::State::FINISHED);
+ if (sleep->surf_action_)
+ sleep->surf_action_->finish(simgrid::kernel::resource::Action::State::FINISHED);
intrusive_ptr_release(sleep);
},
res.get());
simgrid::kernel::activity::SleepImplPtr sleep =
boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(synchro);
- if (sleep->surf_sleep) {
- sleep->surf_sleep->unref();
- sleep->surf_sleep = nullptr;
+ if (sleep->surf_action_) {
+ sleep->surf_action_->unref();
+ sleep->surf_action_ = nullptr;
}
}
simgrid::kernel::activity::RawImplPtr sync =
simgrid::kernel::activity::RawImplPtr(new simgrid::kernel::activity::RawImpl());
- sync->sleep = smx_host->pimpl_cpu->sleep(timeout);
- sync->sleep->set_data(sync.get());
+ sync->surf_action_ = smx_host->pimpl_cpu->sleep(timeout);
+ sync->surf_action_->set_data(sync.get());
XBT_OUT();
return sync;
}