}
if (timeout < 0.0) {
- simcall->timer = NULL;
+ simcall->timeout_cb = NULL;
} else {
- simcall->timer = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [simcall]() {
+ simcall->timeout_cb = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [simcall]() {
SIMIX_waitany_remove_simcall_from_actions(simcall);
simcall_comm_waitany__set__result(simcall, -1);
simcall->issuer->simcall_answer();
continue; // if process handling comm is killed
if (simcall->call == SIMCALL_COMM_WAITANY) {
SIMIX_waitany_remove_simcall_from_actions(simcall);
- if (simcall->timer) {
- simcall->timer->remove();
- simcall->timer = nullptr;
+ if (simcall->timeout_cb) {
+ simcall->timeout_cb->remove();
+ simcall->timeout_cb = nullptr;
}
if (not MC_is_active() && not MC_record_replay_is_active()) {
CommImpl** comms = simcall_comm_waitany__get__comms(simcall);
size_t count, double timeout)
{
if (timeout < 0.0) {
- simcall->timer = nullptr;
+ simcall->timeout_cb = nullptr;
} else {
- simcall->timer = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [simcall, execs, count]() {
+ simcall->timeout_cb = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [simcall, execs, count]() {
for (size_t i = 0; i < count; i++) {
// Remove the first occurence of simcall:
auto* exec = execs[i];
if (j != exec->simcalls_.end())
exec->simcalls_.erase(j);
- if (simcall->timer) {
- simcall->timer->remove();
- simcall->timer = nullptr;
+ if (simcall->timeout_cb) {
+ simcall->timeout_cb->remove();
+ simcall->timeout_cb = nullptr;
}
}
struct s_smx_simcall {
e_smx_simcall_t call;
smx_actor_t issuer;
- smx_timer_t timer;
+ smx_timer_t timeout_cb; // Callback to timeouts
int mc_value;
u_smx_scalar args[11];
u_smx_scalar result;
return unmarshal(type<T>(), simcall);
}
-template <std::size_t I> inline void marshalArgs(smx_simcall_t simcall)
+template <std::size_t I> inline void marshal_args(smx_simcall_t simcall)
{
/* Nothing to do when no args */
}
-template <std::size_t I, class A> inline void marshalArgs(smx_simcall_t simcall, A const& a)
+template <std::size_t I, class A> inline void marshal_args(smx_simcall_t simcall, A const& a)
{
marshal(simcall->args[I], a);
}
-template <std::size_t I, class A, class... B> inline void marshalArgs(smx_simcall_t simcall, A const& a, B const&... b)
+template <std::size_t I, class A, class... B> inline void marshal_args(smx_simcall_t simcall, A const& a, B const&... b)
{
marshal(simcall->args[I], a);
- marshalArgs<I + 1>(simcall, b...);
+ marshal_args<I + 1>(simcall, b...);
}
/** Initialize the simcall */
simcall->call = call;
memset(&simcall->result, 0, sizeof(simcall->result));
memset(simcall->args, 0, sizeof(simcall->args));
- marshalArgs<0>(simcall, a...);
+ marshal_args<0>(simcall, a...);
}
}
}