Remove unused functions and optimize data race checking for mem* operations
[c11tester.git] / model.h
diff --git a/model.h b/model.h
index 59ca72838adf40eb0649b33e54adeb4adf243869..9e52f53752e016152bcc9d8267890472e391d1a8 100644 (file)
--- a/model.h
+++ b/model.h
 #include "classlist.h"
 #include "snapshot-interface.h"
 
+#define ENTER_MODEL_FLAG (inside_model = 1)
+#define EXIT_MODEL_FLAG (inside_model = 0)
+#define GET_MODEL_FLAG (inside_model)
+#define RESTORE_MODEL_FLAG(f) (inside_model = f)
+
 /** @brief Model checker execution stats */
 struct execution_stats {
        int num_total;  /**< @brief Total number of executions */
@@ -44,6 +49,7 @@ public:
        Thread * get_thread(const ModelAction *act) const;
 
        Thread * get_current_thread() const;
+       thread_id_t get_current_thread_id() const;
 
        uint64_t switch_thread(ModelAction *act);
 
@@ -72,13 +78,10 @@ private:
 
        unsigned int curr_thread_num;
        Thread * chosen_thread;
-       bool thread_chosen;
        bool break_execution;
 
        void startRunExecution(Thread *old);
        void finishRunExecution(Thread *old);
-       void consumeAction();
-       void chooseThread(ModelAction *act, Thread *thr);
        Thread * getNextThread(Thread *old);
        bool handleChosenThread(Thread *old);
 
@@ -106,8 +109,10 @@ private:
        void print_stats() const;
 };
 
+extern int inside_model;
 extern ModelChecker *model;
 void parse_options(struct model_params *params);
 void install_trace_analyses(ModelExecution *execution);
+void createModelIfNotExist();
 
 #endif /* __MODEL_H__ */