rename mypthread.h to pthread.h
[c11tester.git] / nodestack.cc
index fdabf28897f3246d7fdfa22a17e442db05944bf5..c1c3cfc502a7cca8b53f984d0584e7e9750cc609 100644 (file)
  * parent.
  *
  * @param act The ModelAction to associate with this Node. May be NULL.
- * @param par The parent Node in the NodeStack. May be NULL if there is no
- * parent.
  * @param nthreads The number of threads which exist at this point in the
  * execution trace.
  */
-Node::Node(ModelAction *act, Node *par, int nthreads) :
+Node::Node(ModelAction *act) :
        action(act),
-       uninit_action(NULL),
-       parent(par),
-       num_threads(nthreads)
+       uninit_action(NULL)
 {
        ASSERT(act);
        act->set_node(this);
@@ -52,15 +48,13 @@ void Node::print() const
 
 NodeStack::NodeStack() :
        node_list(),
-       head_idx(-1),
-       total_nodes(0)
+       head_idx(-1)
 {
-       total_nodes++;
 }
 
 NodeStack::~NodeStack()
 {
-       for (unsigned int i = 0; i < node_list.size(); i++)
+       for (unsigned int i = 0;i < node_list.size();i++)
                delete node_list[i];
 }
 
@@ -82,7 +76,7 @@ void NodeStack::print() const
 {
        model_print("............................................\n");
        model_print("NodeStack printing node_list:\n");
-       for (unsigned int it = 0; it < node_list.size(); it++) {
+       for (unsigned int it = 0;it < node_list.size();it++) {
                if ((int)it == this->head_idx)
                        model_print("vvv following action is the current iterator vvv\n");
                node_list[it]->print();
@@ -96,27 +90,19 @@ ModelAction * NodeStack::explore_action(ModelAction *act)
 {
        DBG();
 
-       /* Record action */
-       Node *head = get_head();
-
-       int next_threads = execution->get_num_threads();
-       if (act->get_type() == THREAD_CREATE || act->get_type() == PTHREAD_CREATE ) // may need to be changed
-               next_threads++;
-       node_list.push_back(new Node(act, head, next_threads));
-       total_nodes++;
+       node_list.push_back(new Node(act));
        head_idx++;
        return NULL;
 }
 
 
 /** Reset the node stack. */
-void NodeStack::full_reset() 
+void NodeStack::full_reset()
 {
-       for (unsigned int i = 0; i < node_list.size(); i++)
+       for (unsigned int i = 0;i < node_list.size();i++)
                delete node_list[i];
        node_list.clear();
        reset_execution();
-       total_nodes = 1;
 }
 
 Node * NodeStack::get_head() const