+#include <string.h>
+
#include "nodestack.h"
#include "action.h"
#include "common.h"
if (act)
act->set_node(this);
enabled_array=(bool *)MYMALLOC(sizeof(bool)*num_threads);
- if (enabled)
+ if (enabled != NULL)
memcpy(enabled_array, enabled, sizeof(bool)*num_threads);
- else
+ else {
for(int i=0;i<num_threads;i++)
enabled_array[i]=false;
+ }
}
/** @brief Node desctructor */
return thread_id < num_threads && enabled_array[thread_id];
}
+bool Node::is_enabled(thread_id_t tid)
+{
+ int thread_id=id_to_int(tid);
+ return thread_id < num_threads && enabled_array[thread_id];
+}
+
/**
* Add an action to the may_read_from set.
* @param act is the action to add
/* Record action */
get_head()->explore_child(act);
- node_list.push_back(new Node(act, get_head(), model->get_num_threads()));
+ node_list.push_back(new Node(act, get_head(), model->get_num_threads(), is_enabled));
total_nodes++;
iter++;
return NULL;