model: privatize ModelChecker::get_num_threads()
[model-checker.git] / nodestack.cc
index f46e4b75571fd03b414760413bc68beff897f16f..80bf5c41bf1d1721e20ad7d6d38fe7f141ed869f 100644 (file)
@@ -9,6 +9,7 @@
 #include "model.h"
 #include "threads-model.h"
 #include "modeltypes.h"
+#include "execution.h"
 
 /**
  * @brief Node constructor
@@ -761,6 +762,15 @@ NodeStack::~NodeStack()
                delete node_list[i];
 }
 
+/**
+ * @brief Register the model-checker object with this NodeStack
+ * @param exec The execution structure for the ModelChecker
+ */
+void NodeStack::register_engine(const ModelExecution *exec)
+{
+       this->execution = exec;
+}
+
 void NodeStack::print() const
 {
        model_print("............................................\n");
@@ -793,7 +803,7 @@ ModelAction * NodeStack::explore_action(ModelAction *act, enabled_type_t *is_ena
                        prevfairness = node_list[head_idx - model->params.fairwindow];
        }
 
-       int next_threads = model->get_num_threads();
+       int next_threads = execution->get_num_threads();
        if (act->get_type() == THREAD_CREATE)
                next_threads++;
        node_list.push_back(new Node(act, head, next_threads, prevfairness));