nodestack: add 'may_read_from' set
[c11tester.git] / nodestack.cc
index 65afd7c89c1071e1abadf304cbf461a2c9923ec4..87b3ee531fbe2d10a7b52f229f23e7ea90196e9d 100644 (file)
@@ -9,7 +9,8 @@ Node::Node(ModelAction *act, int nthreads)
        num_threads(nthreads),
        explored_children(num_threads),
        backtrack(num_threads),
-       numBacktracks(0)
+       numBacktracks(0),
+       may_read_from()
 {
 }
 
@@ -99,6 +100,15 @@ bool Node::is_enabled(Thread *t)
        return id_to_int(t->get_id()) < num_threads;
 }
 
+/**
+ * Add an action to the may_read_from set.
+ * @param act is the action to add
+ */
+void Node::add_read_from(ModelAction *act)
+{
+       may_read_from.insert(act);
+}
+
 void Node::explore(thread_id_t tid)
 {
        int i = id_to_int(tid);