void printRace(struct DataRace * race) {
printf("Datarace detected\n");
printf("Location %p\n", race->address);
- printf("Initial access: thread %u clock %u, iswrite %u\n",race->oldthread,race->oldclock, race->isoldwrite);
- printf("Second access: thread %u clock %u, iswrite %u\n", race->newaction->get_tid(), race->newaction->get_seq_number() , race->isnewwrite);
+ printf("Initial access: thread %u clock %u, iswrite %u\n", id_to_int(race->oldthread), race->oldclock, race->isoldwrite);
+ printf("Second access: thread %u clock %u, iswrite %u\n", id_to_int(race->newaction->get_tid()), race->newaction->get_seq_number(), race->isnewwrite);
}
/** This function does race detection for a write on an expanded record. */
int thrd_join(thrd_t t)
{
Thread *th = model->get_thread(thrd_to_id(t));
- model->switch_to_master(new ModelAction(THREAD_JOIN, std::memory_order_seq_cst, th, thrd_to_id(t)));
+ model->switch_to_master(new ModelAction(THREAD_JOIN, std::memory_order_seq_cst, th, id_to_int(thrd_to_id(t))));
return 0;
}
} 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 (!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);
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)