simcall->timeout_cb_ = NULL;
} else {
simcall->timeout_cb_ = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [simcall]() {
+ simcall->timeout_cb_ = nullptr;
SIMIX_waitany_remove_simcall_from_actions(simcall);
simcall_comm_waitany__set__result(simcall, -1);
simcall->issuer_->simcall_answer();
simcall->timeout_cb_ = nullptr;
} else {
simcall->timeout_cb_ = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [simcall, execs, count]() {
+ simcall->timeout_cb_ = nullptr;
for (size_t i = 0; i < count; i++) {
// Remove the first occurrence of simcall:
auto* exec = execs[i];
XBT_DEBUG("Cleanup actor %s (%p), waiting synchro %p", get_cname(), this, waiting_synchro.get());
- /* Unregister from the kill timer if any */
+ /* Unregister associated timers if any */
if (kill_timer != nullptr) {
kill_timer->remove();
kill_timer = nullptr;
}
+ if (simcall.timeout_cb_) {
+ simcall.timeout_cb_->remove();
+ simcall.timeout_cb_ = nullptr;
+ }
+
cleanup_from_simix();
context_->set_wannadie(false); // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops