+ else {
+ /* we need a sleep action (even when there is no timeout) to be notified of host failures */
+ if (synchro->get_disk() != nullptr)
+ synchro->set_timeout_detector(synchro->get_disk()->get_host()->pimpl_cpu->sleep(timeout));
+ else
+ synchro->set_timeout_detector(
+ simgrid::s4u::Host::by_name(synchro->get_storage()->get_host())->pimpl_cpu->sleep(timeout));
+ }
+}
+
+void simcall_HANDLER_io_test(smx_simcall_t simcall, simgrid::kernel::activity::IoImpl* synchro)
+{
+ bool res = (synchro->state_ != simgrid::kernel::activity::State::WAITING &&
+ synchro->state_ != simgrid::kernel::activity::State::RUNNING);
+ if (res) {
+ synchro->simcalls_.push_back(simcall);
+ synchro->finish();
+ } else {
+ simcall->issuer_->simcall_answer();
+ }
+ simcall_io_test__set__result(simcall, res);