priv = (struct model_snapshot_members *)calloc(1, sizeof(*priv));
/* First thread created will have id INITIAL_THREAD_ID */
priv->next_thread_id = INITIAL_THREAD_ID;
+
+ lazy_sync_size = &priv->lazy_sync_size;
}
/** @brief Destructor */
/** @returns whether the current partial trace must be a prefix of a
* feasible trace. */
-
bool ModelChecker::isfeasibleprefix() {
- return promises->size()==0;
+ return promises->size() == 0 && *lazy_sync_size == 0;
}
/** @returns whether the current partial trace is feasible. */
std::list<ModelAction *> *list;
list = lazy_sync_with_release->get_safe_ptr(act->get_location());
list->push_back(act);
+ (*lazy_sync_size)++;
}
}
propagate->synchronize_with(act);
}
}
- if (complete)
+ if (complete) {
it = list->erase(it);
- else
+ (*lazy_sync_size)--;
+ } else
it++;
}
modelclock_t used_sequence_numbers;
Thread *nextThread;
ModelAction *next_backtrack;
+
+ /** @see ModelChecker::lazy_sync_size */
+ unsigned int lazy_sync_size;
};
/** @brief The central structure for model-checking */
*/
HashTable<void *, std::list<ModelAction *>, uintptr_t, 4> *lazy_sync_with_release;
+ /**
+ * Represents the total size of the
+ * ModelChecker::lazy_sync_with_release lists. This count should be
+ * snapshotted, so it is actually a pointer to a location within
+ * ModelChecker::priv
+ */
+ unsigned int *lazy_sync_size;
+
std::vector<ModelAction *> *thrd_last_action;
NodeStack *node_stack;