Ejemplo n.º 1
0
/**
 * \brief Makes a fifo empty.
 * \param l a fifo
 *
 * None of the objects that was in the fifo is however modified.
 */
void xbt_fifo_reset(xbt_fifo_t l)
{
  xbt_fifo_item_t b, tmp;

  for (b = xbt_fifo_get_first_item(l); b;
       tmp = b, b = b->next, xbt_fifo_free_item(tmp));
  l->head = l->tail = NULL;
}
Ejemplo n.º 2
0
static int is_exploration_stack_pair(simgrid::mc::VisitedPair* pair){
  xbt_fifo_item_t item = xbt_fifo_get_first_item(mc_stack);
  while (item) {
    if (((simgrid::mc::Pair*)xbt_fifo_get_item_content(item))->num == pair->num){
      ((simgrid::mc::Pair*)xbt_fifo_get_item_content(item))->visited_pair_removed = 1;
      return 1;
    }
    item = xbt_fifo_get_next_item(item);
  }
  return 0;
}
Ejemplo n.º 3
0
static int is_exploration_stack_state(mc_state_t current_state) {

    xbt_fifo_item_t item;
    mc_state_t stack_state;
    for(item = xbt_fifo_get_first_item(mc_stack); item != nullptr; item = xbt_fifo_get_next_item(item)) {
        stack_state = (mc_state_t) xbt_fifo_get_item_content(item);
        if(snapshot_compare(stack_state, current_state) == 0) {
            XBT_INFO("Non-progressive cycle : state %d -> state %d", stack_state->num, current_state->num);
            return 1;
        }
    }
    return 0;
}