- if(!initial_state_safety->initial_communications_pattern_done)
- complete_comm_pattern(initial_communications_pattern, simcall_comm_wait__get__comm(req));
- else
- complete_comm_pattern(communications_pattern, simcall_comm_wait__get__comm(req));
+ current_comm = simcall_comm_wait__get__comm(req);
+ if(current_comm->comm.refcount == 1){ /* First wait only must be considered */
+ if(!initial_state_safety->initial_communications_pattern_done)
+ complete_comm_pattern(initial_communications_pattern, current_comm);
+ else
+ complete_comm_pattern(communications_pattern, current_comm);
+ }
+ }else if(comm_pattern == 4){
+ current_comm = xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), value, smx_action_t);
+ if(current_comm->comm.refcount == 1){ /* First wait only must be considered */
+ if(!initial_state_safety->initial_communications_pattern_done)
+ complete_comm_pattern(initial_communications_pattern, current_comm);
+ else
+ complete_comm_pattern(communications_pattern, current_comm);
+ }