X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f4d38cfaf4833e416c72a7ca427dd5cd6a0af2e2..791d2a621277a221aa84be5602565208ca441f44:/src/simix/ActorImpl.cpp diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index fe1c95647b..b01c51aab2 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -176,9 +176,7 @@ smx_activity_t ActorImpl::suspend(ActorImpl* issuer) return nullptr; } else { - activity::ExecImplPtr exec = activity::ExecImplPtr(new activity::ExecImpl("suspend", "", nullptr, this->host_)); - exec->start(0.0, 1.0, 0.0); - return exec; + return activity::ExecImplPtr(new activity::ExecImpl("suspend", "", nullptr, this->host_))->start(0.0, 1.0, 0.0); } } @@ -208,13 +206,8 @@ smx_activity_t ActorImpl::sleep(double duration) throw_exception(std::make_exception_ptr(simgrid::HostFailureException( XBT_THROW_POINT, std::string("Host ") + std::string(host_->get_cname()) + " failed, you cannot sleep there."))); - simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl(); - synchro->host = host_; - synchro->surf_action_ = host_->pimpl_cpu->sleep(duration); - synchro->surf_action_->set_data(synchro); - XBT_DEBUG("Create sleep synchronization %p", synchro); - - return synchro; + return simgrid::kernel::activity::SleepImplPtr(new simgrid::kernel::activity::SleepImpl("sleep", host_)) + ->start(duration); } void ActorImpl::throw_exception(std::exception_ptr e)