static void SIMIX_comm_copy_data(smx_action_t comm);
static smx_action_t SIMIX_comm_new(e_smx_comm_type_t type);
static XBT_INLINE void SIMIX_rdv_push(smx_rdv_t rdv, smx_action_t comm);
+static smx_action_t SIMIX_fifo_probe_comm(xbt_fifo_t fifo, e_smx_comm_type_t type,
+ int (*match_fun)(void *, void *,smx_action_t),
+ void *user_data, smx_action_t my_action);
static smx_action_t SIMIX_fifo_get_comm(xbt_fifo_t fifo, e_smx_comm_type_t type,
int (*match_fun)(void *, void *,smx_action_t),
void *user_data, smx_action_t my_action);
XBT_DEBUG("iprobe from %p %p\n", rdv, rdv->comm_fifo);
smx_action_t this_action = SIMIX_comm_new(SIMIX_COMM_RECEIVE);
- smx_action_t other_action;
+ smx_action_t other_action=NULL;
if(rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0){
//find a match in the already received fifo
+ XBT_DEBUG("first try in the perm recv mailbox \n");
+
other_action = SIMIX_fifo_probe_comm(rdv->done_comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_action);
- }else{
- other_action = SIMIX_fifo_probe_comm(rdv->comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_action);
}
+ // }else{
+ if(!other_action){
+ XBT_DEBUG("second try in the other mailbox");
+ other_action = SIMIX_fifo_probe_comm(rdv->comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_action);
+ }
+// }
if(other_action)other_action->comm.refcount--;
SIMIX_comm_destroy(this_action);