-
- set_exception(simcall->issuer_);
-
- simcall->issuer_->waiting_synchro_ = nullptr;
- simcall->issuer_->simcall_answer();
- }
-}
-
-void IoImpl::wait_any_for(actor::ActorImpl* issuer, const std::vector<IoImpl*>& ios, double timeout)
-{
- if (timeout < 0.0) {
- issuer->simcall_.timeout_cb_ = nullptr;
- } else {
- issuer->simcall_.timeout_cb_ = timer::Timer::set(s4u::Engine::get_clock() + timeout, [issuer, &ios]() {
- issuer->simcall_.timeout_cb_ = nullptr;
- for (auto* io : ios)
- io->unregister_simcall(&issuer->simcall_);
- // default result (-1) is set in actor::IoWaitanySimcall
- issuer->simcall_answer();
- });
- }
-
- for (auto* io : ios) {
- /* associate this simcall to the the synchro */
- io->simcalls_.push_back(&issuer->simcall_);
-
- /* see if the synchro is already finished */
- if (io->get_state() != State::WAITING && io->get_state() != State::RUNNING) {
- io->finish();
- break;
- }