for(int i = low_tid; i < high_tid; i++) {
thread_id_t tid = int_to_id(i);
+ /* Make sure this thread can be enabled here. */
+ if (i >= node->get_num_threads())
+ break;
+
/* Don't backtrack into a point where the thread is disabled or sleeping. */
if (node->get_enabled_array()[i]!=THREAD_ENABLED)
continue;
bool Node::set_backtrack(thread_id_t id)
{
int i = id_to_int(id);
+ ASSERT(i<((int)backtrack.size()));
if (backtrack[i])
return false;
backtrack[i] = true;
void Node::explore(thread_id_t tid)
{
int i = id_to_int(tid);
+ ASSERT(i<((int)backtrack.size()));
if (backtrack[i]) {
backtrack[i] = false;
numBacktracks--;
*/
class Node {
public:
- Node(ModelAction *act = NULL, Node *par = NULL, int nthreads = 1, Node *prevfairness = NULL);
+ Node(ModelAction *act = NULL, Node *par = NULL, int nthreads = 2, Node *prevfairness = NULL);
~Node();
/* return true = thread choice has already been explored */
bool has_been_explored(thread_id_t tid);