continue; // if process handling comm is killed
if (auto* observer =
dynamic_cast<kernel::actor::ExecutionWaitanySimcall*>(simcall->observer_)) { // simcall is a wait_any?
- const auto* execs = observer->get_execs();
+ const auto& execs = observer->get_execs();
- for (auto* exec : *execs) {
+ for (auto* exec : execs) {
exec->unregister_simcall(simcall);
if (simcall->timeout_cb_) {
}
if (not MC_is_active() && not MC_record_replay_is_active()) {
- auto element = std::find(execs->begin(), execs->end(), this);
- int rank = element != execs->end() ? static_cast<int>(std::distance(execs->begin(), element)) : -1;
+ auto element = std::find(execs.begin(), execs.end(), this);
+ int rank = element != execs.end() ? static_cast<int>(std::distance(execs.begin(), element)) : -1;
observer->set_result(rank);
}
}
return this;
}
-void ExecImpl::wait_any_for(actor::ActorImpl* issuer, const std::vector<ExecImpl*>* execs, double timeout)
+void ExecImpl::wait_any_for(actor::ActorImpl* issuer, const std::vector<ExecImpl*>& execs, double timeout)
{
if (timeout < 0.0) {
issuer->simcall_.timeout_cb_ = nullptr;
} else {
- issuer->simcall_.timeout_cb_ = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [issuer, execs]() {
+ issuer->simcall_.timeout_cb_ = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [issuer, &execs]() {
issuer->simcall_.timeout_cb_ = nullptr;
- for (auto* exec : *execs)
+ for (auto* exec : execs)
exec->unregister_simcall(&issuer->simcall_);
// default result (-1) is set in mc::ExecutionWaitanySimcall
issuer->simcall_answer();
});
}
- for (auto* exec : *execs) {
+ for (auto* exec : execs) {
/* associate this simcall to the the synchro */
exec->simcalls_.push_back(&issuer->simcall_);