comm->mbox_cpy = comm->mbox;
#endif
comm->mbox = nullptr;
- return std::move(comm);
+ return comm;
}
XBT_DEBUG("Sorry, communication synchro %p does not match our needs:"
" its type is %d but we are looking for a comm of type %d (or maybe the filtering didn't match)",
XBT_DEBUG("We have a comm that has probably already been received, trying to match it, to skip the communication");
//find a match in the list of already received comms
- other_comm = std::move(_find_matching_comm(&mbox->done_comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,
- /*remove_matching*/ true));
+ other_comm = _find_matching_comm(&mbox->done_comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,
+ /*remove_matching*/ true);
//if not found, assume the receiver came first, register it to the mailbox in the classical way
if (not other_comm) {
XBT_DEBUG("We have messages in the permanent receive list, but not the one we are looking for, pushing request into list");
- other_comm = this_synchro;
- mbox->push(this_synchro);
+ other_comm = std::move(this_synchro);
+ mbox->push(other_comm);
} else {
if (other_comm->surf_comm && other_comm->remains() < 1e-12) {
XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get());
if (other_comm == nullptr) {
XBT_DEBUG("Receive pushed first (%zu comm enqueued so far)", mbox->comm_queue.size());
- other_comm = this_synchro;
- mbox->push(this_synchro);
+ other_comm = std::move(this_synchro);
+ mbox->push(other_comm);
} else {
XBT_DEBUG("Match my %p with the existing %p", this_synchro.get(), other_comm.get());
/* If any of the process is suspend, create the synchro but stop its execution,
it will be restarted when the sender process resume */
- if (SIMIX_process_is_suspended(comm->src_proc) || SIMIX_process_is_suspended(comm->dst_proc)) {
- if (SIMIX_process_is_suspended(comm->src_proc))
+ if (comm->src_proc->isSuspended() || comm->dst_proc->isSuspended()) {
+ if (comm->src_proc->isSuspended())
XBT_DEBUG("The communication is suspended on startup because src (%s@%s) was suspended since it initiated the "
"communication",
comm->src_proc->cname(), comm->src_proc->host->cname());