XBT_CRITICAL("MSG_task_irecv() was asked to write in a non empty task struct.");
/* Try to receive it by calling SIMIX network layer */
- msg_comm_t comm = new simgrid::msg::Comm(
- nullptr, task, mbox->get_init()->set_dst_data((void**)task, sizeof(msg_task_t*))->set_rate(rate)->start());
+ simgrid::s4u::CommPtr comm = simgrid::s4u::Mailbox::by_name(name)
+ ->get_init()
+ ->set_dst_data((void**)task, sizeof(msg_task_t*))
+ ->set_rate(rate)
+ ->start();
- return comm;
+ return new simgrid::msg::Comm(nullptr, task, comm);
}
/**
else
return -1;
}
-