X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c19a107a096f503e67217fb178fa98eb742ceb4d..89f389e6348fde6457d692ef1f0a81d55f658b1d:/src/s4u/s4u_Io.cpp diff --git a/src/s4u/s4u_Io.cpp b/src/s4u/s4u_Io.cpp index c88ccc7fd4..926f269024 100644 --- a/src/s4u/s4u_Io.cpp +++ b/src/s4u/s4u_Io.cpp @@ -47,6 +47,7 @@ Io* Io::cancel() { simgrid::kernel::actor::simcall([this] { boost::static_pointer_cast(pimpl_)->cancel(); }); state_ = State::CANCELED; + on_completion(*this); return this; } @@ -72,7 +73,12 @@ Io* Io::wait_for(double timeout) IoPtr Io::set_disk(sg_disk_t disk) { disk_ = disk; - return this; + + // Setting the disk may allow to start the activity, let's try + if (state_ == State::STARTING) + vetoable_start(); + + return this; } IoPtr Io::set_size(sg_size_t size)