Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add a StorageFailureException
[simgrid.git] / src / kernel / activity / IoImpl.cpp
index 2d21d27..5fac5af 100644 (file)
@@ -13,7 +13,7 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-IoImpl::IoImpl(std::string name, surf::StorageImpl* storage) : ActivityImpl(name), storage_(storage)
+IoImpl::IoImpl(std::string name, surf::StorageImpl* storage) : ActivityImpl(std::move(name)), storage_(storage)
 {
   this->state_ = SIMIX_RUNNING;
 
@@ -32,7 +32,7 @@ IoImpl* IoImpl::start(sg_size_t size, simgrid::s4u::Io::OpType type)
   surf_action_ = storage_->io_start(size, type);
   surf_action_->set_data(this);
 
-  XBT_DEBUG("Create IO synchro %p %s", this, name_.c_str());
+  XBT_DEBUG("Create IO synchro %p %s", this, get_cname());
   simgrid::kernel::activity::IoImpl::on_start(this);
 
   return this;
@@ -43,6 +43,7 @@ void IoImpl::cancel()
   XBT_VERB("This exec %p is canceled", this);
   if (surf_action_ != nullptr)
     surf_action_->cancel();
+  state_ = SIMIX_CANCELED;
 }
 
 double IoImpl::get_remaining()