-simgrid::kernel::activity::IoImpl::IoImpl(std::string name, simgrid::surf::StorageImpl* storage)
- : ActivityImpl(name), storage_(storage)
+void simcall_HANDLER_io_wait(smx_simcall_t simcall, smx_activity_t synchro)
+{
+ XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro.get(), (int)synchro->state_);
+
+ /* Associate this simcall to the synchro */
+ synchro->simcalls_.push_back(simcall);
+ simcall->issuer->waiting_synchro = synchro;
+
+ /* set surf's synchro */
+ if (MC_is_active() || MC_record_replay_is_active()) {
+ synchro->state_ = SIMIX_DONE;
+ boost::static_pointer_cast<simgrid::kernel::activity::IoImpl>(synchro)->finish();
+ return;
+ }
+
+ /* If the synchro is already finished then perform the error handling */
+ if (synchro->state_ != SIMIX_RUNNING)
+ boost::static_pointer_cast<simgrid::kernel::activity::IoImpl>(synchro)->finish();
+}
+
+namespace simgrid {
+namespace kernel {
+namespace activity {
+
+IoImpl::IoImpl(std::string name, surf::StorageImpl* storage) : ActivityImpl(std::move(name)), storage_(storage)