pending_rel_seqs->size());
- if (isfinalfeasible() || (params.bound != 0 && priv->used_sequence_numbers > params.bound ) || DBG_ENABLED() )
+ if (isfinalfeasible() || (params.bound != 0 && priv->used_sequence_numbers > params.bound ) || DBG_ENABLED() ) {
+ checkDataRaces();
print_summary();
+ }
if ((diverge = get_next_backtrack()) == NULL)
return false;
/* Iterate over all threads */
for (i = 0; i < thrd_lists->size(); i++) {
- ModelAction *write_after_read = NULL;
+ const ModelAction *write_after_read = NULL;
/* Iterate over actions in thread, starting from most recent */
action_list_t *list = &(*thrd_lists)[i];
break;
else if (act->is_write())
write_after_read = act;
+ else if (act->is_read()&&act->get_reads_from()!=NULL) {
+ write_after_read = act->get_reads_from();
+ }
}
-
- if (write_after_read && mo_graph->checkReachable(write_after_read, writer))
+
+ if (write_after_read && write_after_read!=writer && mo_graph->checkReachable(write_after_read, writer))
return false;
}
}
}
+void ModelChecker::check_promises_thread_disabled() {
+ for (unsigned int i = 0; i < promises->size(); i++) {
+ Promise *promise = (*promises)[i];
+ if (promise->check_promise()) {
+ failed_promise = true;
+ return;
+ }
+ }
+}
+
/** Checks promises in response to addition to modification order for threads.
* Definitions:
* pthread is the thread that performed the read that created the promise
if (promise->has_sync_thread(tid))
continue;
- if (mo_graph->checkReachable(promise->get_write(), write)) {
+ if (promise->get_write()&&mo_graph->checkReachable(promise->get_write(), write)) {
if (promise->increment_threads(tid)) {
failed_promise = true;
return;
bool isfeasible();
bool isfeasibleotherthanRMW();
bool isfinalfeasible();
+ void check_promises_thread_disabled();
void mo_check_promises(thread_id_t tid, const ModelAction *write);
void check_promises(thread_id_t tid, ClockVector *old_cv, ClockVector * merge_cv);
void get_release_seq_heads(ModelAction *act, rel_heads_list_t *release_heads);
synced_thread[id]=true;
enabled_type_t * enabled=model->get_scheduler()->get_enabled();
unsigned int sync_size=synced_thread.size();
- for(unsigned int i=0;i<model->get_num_threads();i++) {
- if ((i >= sync_size || !synced_thread[i]) && (enabled[i] != THREAD_DISABLED))
+ int promise_tid=id_to_int(read->get_tid());
+ for(unsigned int i=1;i<model->get_num_threads();i++) {
+ if ((i >= sync_size || !synced_thread[i]) && ( i != promise_tid ) && (enabled[i] != THREAD_DISABLED)) {
return false;
+ }
+ }
+ return true;
+}
+
+bool Promise::check_promise() {
+ enabled_type_t * enabled=model->get_scheduler()->get_enabled();
+ unsigned int sync_size=synced_thread.size();
+ for(unsigned int i=1;i<model->get_num_threads();i++) {
+ if ((i >= sync_size || !synced_thread[i]) && (enabled[i] != THREAD_DISABLED)) {
+ return false;
+ }
}
return true;
}