- xbt_fifo_foreach(fifo, item, synchro, smx_synchro_t) {
- if (synchro->comm.type == SIMIX_COMM_SEND) {
- other_user_data = synchro->comm.src_data;
- } else if (synchro->comm.type == SIMIX_COMM_RECEIVE) {
- other_user_data = synchro->comm.dst_data;
- }
- if (synchro->comm.type == type &&
- (!match_fun || match_fun(this_user_data, other_user_data, synchro)) &&
- (!synchro->comm.match_fun || synchro->comm.match_fun(other_user_data, this_user_data, my_synchro))) {
- XBT_DEBUG("Found a matching communication synchro %p", synchro);
- xbt_fifo_remove_item(fifo, item);
- xbt_fifo_free_item(item);
- synchro->comm.refcount++;
-#ifdef HAVE_MC
- synchro->comm.rdv_cpy = synchro->comm.rdv;
-#endif
- synchro->comm.rdv = NULL;
- return synchro;
+ comm->mbox = NULL;
+ for (auto it = mbox->comm_queue->begin(); it != mbox->comm_queue->end(); it++)
+ if (*it == comm) {
+ mbox->comm_queue->erase(it);
+ return;