Previously, I naively set a backtracking point for the thread that performed
the conflicting action, whether or not that thread existed at the point to
which I am backtracking. Utilize the TreeNode::is_enabled() method, plus thread
parent walking, to find the correct thread for the backtracking.
Note that this also requires a model checking event for each THREAD_CREATE
event. So add this feature.
DBG();
ret = model->add_thread(new Thread(t, start_routine, arg));
DEBUG("create thread %d\n", id_to_int(thrd_to_id(*t)));
+ /* seq_cst is just a 'don't care' parameter */
+ model->switch_to_master(new ModelAction(THREAD_CREATE, memory_order_seq_cst, NULL, VALUE_NONE));
return ret;
}
node = prev->get_node();
+ while (t && !node->is_enabled(t))
+ t = t->get_parent();
+
/* Check if this has been explored already */
if (node->hasBeenExplored(t->get_id()))
return;