} else {
tid = next->get_tid();
}
- DEBUG("*** ModelChecker chose next thread = %d ***\n", tid);
+ DEBUG("*** ModelChecker chose next thread = %d ***\n", id_to_int(tid));
ASSERT(tid != THREAD_ID_T_NONE);
return thread_map->get(id_to_int(tid));
}
if (isfinalfeasible()) {
printf("Earliest divergence point since last feasible execution:\n");
if (earliest_diverge)
- earliest_diverge->print(false);
+ earliest_diverge->print();
else
printf("(Not set)\n");
if (!node->set_backtrack(tid))
continue;
DEBUG("Setting backtrack: conflict = %d, instead tid = %d\n",
- prev->get_tid(), t->get_id());
+ id_to_int(prev->get_tid()),
+ id_to_int(t->get_id()));
if (DBG_ENABLED()) {
prev->print();
act->print();
/** Close out a RMWR by converting previous RMWR into a RMW or READ. */
ModelAction * ModelChecker::process_rmw(ModelAction *act) {
- int tid = id_to_int(act->get_tid());
- ModelAction *lastread = get_last_action(tid);
+ ModelAction *lastread = get_last_action(act->get_tid());
lastread->process_rmw(act);
if (act->is_rmw() && lastread->get_reads_from()!=NULL) {
mo_graph->addRMWEdge(lastread->get_reads_from(), lastread);
* @return true, if the ModelChecker is certain that release_heads is complete;
* false otherwise
*/
-bool ModelChecker::release_seq_head(const ModelAction *rf, rel_heads_list_t *release_heads) const
+bool ModelChecker::release_seq_heads(const ModelAction *rf, rel_heads_list_t *release_heads) const
{
/* Only check for release sequences if there are no cycles */
if (mo_graph->checkForCycles())
ModelAction *last = get_last_action(int_to_id(i));
if (last && (rf->happens_before(last) ||
- last->get_type() == THREAD_FINISH))
+ get_thread(int_to_id(i))->is_complete()))
future_ordered = true;
for (rit = list->rbegin(); rit != list->rend(); rit++) {
* @param act The 'acquire' action that may read from a release sequence
* @param release_heads A pass-by-reference return parameter. Will be filled
* with the head(s) of the release sequence(s), if they exists with certainty.
- * @see ModelChecker::release_seq_head
+ * @see ModelChecker::release_seq_heads
*/
void ModelChecker::get_release_seq_heads(ModelAction *act, rel_heads_list_t *release_heads)
{
const ModelAction *rf = act->get_reads_from();
bool complete;
- complete = release_seq_head(rf, release_heads);
+ complete = release_seq_heads(rf, release_heads);
if (!complete) {
/* add act to 'lazy checking' list */
pending_acq_rel_seq->push_back(act);
const ModelAction *rf = act->get_reads_from();
rel_heads_list_t release_heads;
bool complete;
- complete = release_seq_head(rf, &release_heads);
+ complete = release_seq_heads(rf, &release_heads);
for (unsigned int i = 0; i < release_heads.size(); i++) {
if (!act->has_synchronized_with(release_heads[i])) {
if (act->synchronize_with(release_heads[i]))
* @param tid The Thread's ID
* @return A Thread reference
*/
-Thread * ModelChecker::get_thread(thread_id_t tid)
+Thread * ModelChecker::get_thread(thread_id_t tid) const
{
return thread_map->get(id_to_int(tid));
}
* @param act The ModelAction
* @return A Thread reference
*/
-Thread * ModelChecker::get_thread(ModelAction *act)
+Thread * ModelChecker::get_thread(ModelAction *act) const
{
return get_thread(act->get_tid());
}
if (!isfeasible())
return false;
- DEBUG("(%d, %d)\n", curr ? curr->get_id() : -1, next ? next->get_id() : -1);
+ DEBUG("(%d, %d)\n", curr ? id_to_int(curr->get_id()) : -1,
+ next ? id_to_int(next->get_id()) : -1);
/* next == NULL -> don't take any more steps */
if (!next)