fix bug...this is another evil one...
[c11tester.git] / model.h
diff --git a/model.h b/model.h
index 1dc6a158d3aa63247d1051977fe734f1b9cf042f..d89a8a2b123b1743c58f3c5d7c883c87263b45b9 100644 (file)
--- a/model.h
+++ b/model.h
@@ -16,8 +16,7 @@
 #include "action.h"
 
 /* Forward declaration */
-class TreeNode;
-class Backtrack;
+class NodeStack;
 
 class ModelChecker {
 public:
@@ -35,15 +34,17 @@ public:
 
        int add_thread(Thread *t);
        void remove_thread(Thread *t);
-       Thread * get_thread(thread_id_t tid) { return thread_map[id_to_int(tid)]; }
+       Thread * get_thread(thread_id_t tid) { return (*thread_map)[id_to_int(tid)]; }
 
        thread_id_t get_next_id();
+       int get_num_threads();
        int get_next_seq_num();
 
        int switch_to_master(ModelAction *act);
 
        bool next_execution();
-  MEMALLOC
+
+       MEMALLOC
 private:
        int next_thread_id;
        int used_sequence_numbers;
@@ -52,20 +53,26 @@ private:
        ModelAction * get_last_conflict(ModelAction *act);
        void set_backtracking(ModelAction *act);
        thread_id_t get_next_replay_thread();
-       Backtrack * get_next_backtrack();
+       ModelAction * get_next_backtrack();
        void reset_to_initial_state();
 
+       void add_action_to_lists(ModelAction *act);
+       ModelAction * get_last_action(thread_id_t tid);
+       ModelAction * get_parent_action(thread_id_t tid);
+
        void print_list(action_list_t *list);
 
-       class ModelAction *current_action;
-       Backtrack *exploring;
+       ModelAction *current_action;
+       ModelAction *diverge;
        thread_id_t nextThread;
 
        ucontext_t *system_context;
        action_list_t *action_trace;
-       std::map<int, class Thread *, std::less< int >, MyAlloc< std::pair< const int, class Thread * > > > thread_map;
-       class TreeNode *rootNode, *currentNode;
-       std::list<class Backtrack *, MyAlloc< class Backtrack * > > backtrack_list;
+       std::map<int, class Thread *> *thread_map;
+       std::map<void *, std::vector<action_list_t> > *obj_thrd_map;
+       std::vector<ModelAction *> *thrd_last_action;
+       class NodeStack *node_stack;
+       ModelAction *next_backtrack;
 };
 
 extern ModelChecker *model;