X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=nodestack.cc;h=7471c744d1a19e5b57c3ebce764fbb754dc79b86;hb=d5c56ae55e7adf3e489de357ed5c80c640b67ec9;hp=3db80e8f6b4f8931ad3a238215c4294c86cd9708;hpb=b8b39c87557325a384faa45d0cae56a6f71f52b1;p=model-checker.git diff --git a/nodestack.cc b/nodestack.cc index 3db80e8..7471c74 100644 --- a/nodestack.cc +++ b/nodestack.cc @@ -4,7 +4,7 @@ #include "action.h" #include "common.h" #include "model.h" -#include "threads.h" +#include "threads-model.h" /** * @brief Node constructor @@ -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); @@ -49,7 +51,7 @@ Node::Node(ModelAction *act, Node *par, int nthreads, Node *prevfairness) if (prevfi) { *fi=*prevfi; } - if (parent->enabled_array[i]==THREAD_ENABLED) { + if (parent->is_enabled(int_to_id(i))) { fi->enabled_count++; } if (i==currtid) { @@ -58,7 +60,7 @@ Node::Node(ModelAction *act, Node *par, int nthreads, Node *prevfairness) } //Do window processing if (prevfairness != NULL) { - if (prevfairness -> parent->enabled_array[i] == THREAD_ENABLED) + if (prevfairness -> parent->is_enabled(int_to_id(i))) fi->enabled_count--; if (i==prevtid) { fi->turns--; @@ -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; +} + + /** * Adds a value from a weakly ordered future write to backtrack to. * @param value is the value to backtrack to.