model: refactor "get next thread" code
[c11tester.git] / model.h
diff --git a/model.h b/model.h
index 9762eb0c40ef26c5efc92887c6f4f18864e620a0..1b6bb10a285e4046e4b9bbe727526abf1849f071 100644 (file)
--- a/model.h
+++ b/model.h
@@ -39,6 +39,9 @@ struct model_snapshot_members {
        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 */
@@ -102,7 +105,7 @@ private:
 
        ModelAction * get_last_conflict(ModelAction *act);
        void set_backtracking(ModelAction *act);
-       Thread * get_next_replay_thread();
+       Thread * get_next_thread(ModelAction *curr);
        ModelAction * get_next_backtrack();
        void reset_to_initial_state();
        bool resolve_promises(ModelAction *curr);
@@ -142,6 +145,14 @@ private:
         */
        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;