const std::string& get_name() const { return name_; }
const char* get_cname() const { return name_.c_str(); }
- bool test();
+ virtual bool test();
void wait_for(actor::ActorImpl* issuer, double timeout);
virtual ActivityImpl& set_timeout(double) { THROW_UNIMPLEMENTED; }
}
}
-bool simcall_HANDLER_comm_test(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm)
+bool simcall_HANDLER_comm_test(smx_simcall_t, simgrid::kernel::activity::CommImpl* comm)
{
- if ((MC_is_active() || MC_record_replay_is_active()) && comm->src_actor_ && comm->dst_actor_)
- comm->state_ = simgrid::kernel::activity::State::DONE;
-
- bool res = comm->state_ != simgrid::kernel::activity::State::WAITING &&
- comm->state_ != simgrid::kernel::activity::State::RUNNING;
-
- if (res)
- comm->finish();
- return res;
+ return comm->test();
}
void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comms[], size_t count)
copied_ = true;
}
+bool CommImpl::test()
+{
+ if ((MC_is_active() || MC_record_replay_is_active()) && src_actor_ && dst_actor_)
+ state_ = State::DONE;
+ return ActivityImpl::test();
+}
+
void CommImpl::suspend()
{
/* FIXME: shall we suspend also the timeout synchro? */