Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implement a second veto on start. Activity must be assigned to a resource
[simgrid.git] / src / s4u / s4u_Io.cpp
index c88ccc7..dd45f7a 100644 (file)
@@ -72,7 +72,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)