Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Modernize simcall_execution_test().
[simgrid.git] / src / kernel / activity / IoImpl.cpp
index 8472157..8125e0e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -34,6 +34,7 @@ void simcall_HANDLER_io_wait(smx_simcall_t simcall, simgrid::kernel::activity::I
       synchro->state_ = simgrid::kernel::activity::State::TIMEOUT;
     }
     synchro->finish();
+    return;
   }
 
   /* If the synchro is already finished then perform the error handling */
@@ -42,11 +43,10 @@ void simcall_HANDLER_io_wait(smx_simcall_t simcall, simgrid::kernel::activity::I
   else {
     /* we need a sleep action (even when there is no timeout) to be notified of host failures */
     if (synchro->get_disk() != nullptr)
-      synchro->timeout_detector_ = synchro->get_disk()->get_host()->pimpl_cpu->sleep(timeout);
+      synchro->set_timeout_detector(synchro->get_disk()->get_host()->pimpl_cpu->sleep(timeout));
     else
-      synchro->timeout_detector_ =
-          simgrid::s4u::Host::by_name(synchro->get_storage()->get_host())->pimpl_cpu->sleep(timeout);
-    synchro->timeout_detector_->set_activity(synchro);
+      synchro->set_timeout_detector(
+          simgrid::s4u::Host::by_name(synchro->get_storage()->get_host())->pimpl_cpu->sleep(timeout));
   }
 }
 
@@ -134,14 +134,14 @@ void IoImpl::post()
 void IoImpl::finish()
 {
   while (not simcalls_.empty()) {
-    smx_simcall_t simcall = simcalls_.front();
+    const s_smx_simcall* simcall = simcalls_.front();
     simcalls_.pop_front();
     switch (state_) {
       case State::DONE:
         /* do nothing, synchro done */
         break;
       case State::FAILED:
-        simcall->issuer_->context_->iwannadie = true;
+        simcall->issuer_->context_->set_wannadie();
         simcall->issuer_->exception_ =
             std::make_exception_ptr(StorageFailureException(XBT_THROW_POINT, "Storage failed"));
         break;