model: schedule appropriate fence backtracking points
[c11tester.git] / promise.h
index 178b86e7d4b3cedba32f2240f2493e63655efb4d..278b7cc224e34a262ebbca9c20d3294ede514d31 100644 (file)
--- a/promise.h
+++ b/promise.h
@@ -8,10 +8,12 @@
 #define __PROMISE_H__
 
 #include <inttypes.h>
-#include "threads-model.h"
+#include <vector>
 
-#include "model.h"
 #include "modeltypes.h"
+#include "mymemory.h"
+
+class ModelAction;
 
 struct future_value {
        uint64_t value;
@@ -21,16 +23,7 @@ struct future_value {
 
 class Promise {
  public:
-       Promise(ModelAction *read, struct future_value fv) :
-               num_available_threads(0),
-               value(fv.value),
-               expiration(fv.expiration),
-               read(read),
-               write(NULL)
-       {
-               add_thread(fv.tid);
-               eliminate_thread(read->get_tid());
-       }
+       Promise(ModelAction *read, struct future_value fv);
        modelclock_t get_expiration() const { return expiration; }
        ModelAction * get_action() const { return read; }
        bool eliminate_thread(thread_id_t tid);
@@ -41,8 +34,8 @@ class Promise {
        void set_write(const ModelAction *act) { write = act; }
        const ModelAction * get_write() const { return write; }
        int get_num_available_threads() const { return num_available_threads; }
-       bool is_compatible(const ModelAction *write) const;
-       bool is_compatible_exclusive(const ModelAction *write) const;
+       bool is_compatible(const ModelAction *act) const;
+       bool is_compatible_exclusive(const ModelAction *act) const;
 
        void print() const;