namespace activity {
ExecImpl::ExecImpl(std::string name, std::string tracing_category, resource::Action* timeout_detector, s4u::Host* host)
- : ActivityImpl(name), host_(host), timeout_detector_(timeout_detector)
+ : ActivityImpl(std::move(name)), host_(host), timeout_detector_(timeout_detector)
{
this->state_ = SIMIX_RUNNING;
- this->set_category(tracing_category);
+ this->set_category(std::move(tracing_category));
if (timeout_detector != nullptr)
timeout_detector_->set_data(this);
XBT_DEBUG("Destroy exec %p", this);
}
-void ExecImpl::start(double flops_amount, double priority, double bound)
+ExecImpl* ExecImpl::start(double flops_amount, double priority, double bound)
{
if (not MC_is_active() && not MC_record_replay_is_active()) {
surf_action_ = host_->pimpl_cpu->execution_start(flops_amount);
XBT_DEBUG("Create execute synchro %p: %s", this, name_.c_str());
ExecImpl::on_creation(this);
+ return this;
}
void ExecImpl::cancel()
void ExecImpl::post()
{
- if (host_ && host_->is_off()) { /* FIXME: handle resource failure for parallel tasks too */
+ if (host_ && not host_->is_on()) { /* FIXME: handle resource failure for parallel tasks too */
/* If the host running the synchro failed, notice it. This way, the asking
* process can be killed if it runs on that host itself */
state_ = SIMIX_FAILED;