- /* the model-checker wants two separate simcalls */
- simgrid::kernel::activity::ActivityImplPtr comm =
- nullptr; /* MC needs the comm to be set to nullptr during the simcall */
- comm = simcall_comm_isend(sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, nullptr, copy_data_fun,
- data, false);
- simcall_comm_wait(comm.get(), timeout);
+ /* the model-checker wants two separate simcalls, and wants comm to be nullptr during the simcall */
+ simgrid::kernel::activity::ActivityImplPtr comm = nullptr;
+
+ simgrid::kernel::actor::CommIsendSimcall send_observer{
+ sender, mbox, task_size, rate, static_cast<unsigned char*>(src_buff), src_buff_size, match_fun,
+ nullptr, copy_data_fun, data, false};
+ comm = simgrid::kernel::actor::simcall(
+ [&send_observer] { return simgrid::kernel::activity::CommImpl::isend(&send_observer); }, &send_observer);
+
+ simgrid::kernel::actor::ActivityWaitSimcall wait_observer{sender, comm.get(), timeout};
+ if (simgrid::kernel::actor::simcall_blocking(
+ [&wait_observer] {
+ wait_observer.get_activity()->wait_for(wait_observer.get_issuer(), wait_observer.get_timeout());
+ },
+ &wait_observer)) {
+ throw simgrid::TimeoutException(XBT_THROW_POINT, "Timeouted");
+ }