- XBT_VERB("This activity is suspended (remain: %f)", surf_action_->get_remains());
- surf_action_->suspend();
- on_suspended(*this);
+ }
+
+ if (timeout < 0.0) {
+ issuer->simcall_.timeout_cb_ = nullptr;
+ } else {
+ issuer->simcall_.timeout_cb_ = timer::Timer::set(s4u::Engine::get_clock() + timeout, [issuer, &activities]() {
+ issuer->simcall_.timeout_cb_ = nullptr;
+ for (auto* act : activities)
+ act->unregister_simcall(&issuer->simcall_);
+ // default result (-1) is set in actor::ActivityWaitanySimcall
+ issuer->simcall_answer();
+ });
+ }
+
+ for (auto* act : activities) {
+ /* associate this simcall to the the synchro */
+ act->register_simcall(&issuer->simcall_);
+ /* see if the synchro is already finished */
+ if (act->get_state() != State::WAITING && act->get_state() != State::RUNNING) {
+ act->finish();
+ break;
+ }
+ }
+ XBT_DEBUG("Exit from ActivityImlp::wait_any_for");
+}
+
+void ActivityImpl::suspend()
+{
+ XBT_VERB("This activity is suspended (remain: %f)", model_action_->get_remains());
+ get_iface()->fire_on_suspend();
+ get_iface()->fire_on_this_suspend();
+ model_action_->suspend();