num_executions(0),
num_feasible_executions(0),
diverge(NULL),
+ earliest_diverge(NULL),
action_trace(new action_list_t()),
thread_map(new HashTable<int, Thread *, int>()),
obj_map(new HashTable<const void *, action_list_t, uintptr_t, 4>()),
DBG();
num_executions++;
- if (isfinalfeasible())
+ if (isfinalfeasible()) {
+ printf("Earliest divergence point since last feasible execution:\n");
+ earliest_diverge->print();
+
+ earliest_diverge = NULL;
num_feasible_executions++;
+ }
if (isfinalfeasible() || DBG_ENABLED())
print_summary();
if ((diverge = get_next_backtrack()) == NULL)
return false;
+ if (earliest_diverge == NULL || *diverge < *earliest_diverge)
+ earliest_diverge=diverge;
+
if (DBG_ENABLED()) {
printf("Next execution will diverge at:\n");
diverge->print();
void do_complete_join(ModelAction *join);
ModelAction *diverge;
+ ModelAction *earliest_diverge;
ucontext_t system_context;
action_list_t *action_trace;
if (future_values[i].value == value) {
if (future_values[i].expiration>=expiration)
return false;
- if (future_index < i) {
+ if (future_index < ((int) i)) {
suitableindex=i;
}
}
bool Node::increment_read_from() {
DBG();
promises.clear();
- read_from_index++;
- return (read_from_index < may_read_from.size());
+ if ((read_from_index+1) < may_read_from.size()) {
+ read_from_index++;
+ return true;
+ }
+ return false;
}
/**
bool Node::increment_future_value() {
DBG();
promises.clear();
- future_index++;
- return (future_index < future_values.size());
+ if ((future_index+1) < future_values.size()) {
+ future_index++;
+ return true;
+ }
+ return false;
}
void Node::explore(thread_id_t tid)
std::vector< struct future_value, MyAlloc<struct future_value> > future_values;
std::vector< promise_t, MyAlloc<promise_t> > promises;
- unsigned int future_index;
+ int future_index;
};
typedef std::vector< Node *, MyAlloc< Node * > > node_list_t;