commit untested condvar code
[model-checker.git] / nodestack.cc
index a850478e95391a5eecf1ca26ee12c47e4ab4dfcb..ec7ce1694f764e640e099c9f2eb7a431c0b0763c 100644 (file)
@@ -34,7 +34,9 @@ Node::Node(ModelAction *act, Node *par, int nthreads, Node *prevfairness)
        future_values(),
        future_index(-1),
        relseq_break_writes(),
-       relseq_break_index(0)
+       relseq_break_index(0),
+       misc_index(0),
+       misc_max(0)
 {
        if (act) {
                act->set_node(this);
@@ -151,6 +153,24 @@ bool Node::promise_empty() {
        return true;
 }
 
+
+void Node::set_misc_max(int i) {
+       misc_max=i;
+}
+
+int Node::get_misc() {
+       return misc_index;
+}
+
+bool Node::increment_misc() {
+       return (misc_index<misc_max)&&((++misc_index)<misc_max);
+}
+
+bool Node::misc_empty() {
+       return (misc_index+1)>=misc_max;
+}
+
+
 /**
  * Adds a value from a weakly ordered future write to backtrack to.
  * @param value is the value to backtrack to.